本帖最后由 medicside 于 2021-5-12 09:42 编辑
C1Chart 配置如下,绑定DataTable 数据源
数值会有精度 ,如28会显示出27.99999,改怎么调整不显示小数
<c1:C1Chart x:Name="chartPaper" Width="1735">
<c1:C1Chart.Data>
<c1:ChartData>
<c1:XYDataSeries Name="series_paper" />
</c1:ChartData>
</c1:C1Chart.Data>
<c1:C1Chart.View>
<c1:ChartView>
<c1:ChartView.Layers>
<c1:ChartPanel>
<c1:ChartPanelObject
x:Name="objm2"
Width="90"
Height="50"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Action="MouseMove"
Attach="DataX"
DataPoint="-1,-1">
<c1:ChartPanelObject.RenderTransform>
<TranslateTransform Y="-50" />
</c1:ChartPanelObject.RenderTransform>
<Grid DataContext="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=Parent}" Opacity="0.8">
<Path
Data="M0.5,0.5 L23,0.5 23,23 11.61165,29.286408 0.5,23 z"
Fill="#FFF1F1F1"
Stretch="Fill"
Stroke="DarkGray"
StrokeThickness="1" />
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock
x:Name="labelm2"
Margin="2"
FontWeight="Bold"
Text="{Binding DataPoint.Y}" />
</StackPanel>
</Grid>
</c1:ChartPanelObject>
</c1:ChartPanel>
</c1:ChartView.Layers>
</c1:ChartView>
</c1:C1Chart.View>
</c1:C1Chart>
|