Visifire Chart相关属性详解


<vc:Chart x:Name="HourlyChart" Theme="Theme1" Grid.Row="1" xmlns:vc="clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts" Margin="5" AnimatedUpdate="true" IndicatorEnabled="True" ZoomingEnabled="True" ZoomOutText="返回" ShowAllText="退出" >
AnimatedUpdate:是否动画更新
IndicatorEnabled:是否显示指标(如图中第一个)
ZoomingEnabled:是否可以缩放, ZoomOutText:设置返回上一次缩放操作文本,ShowAllText:设置退出缩放文本
ScrollingEnabled:滚动条是否可用
View3D:是否3D显示
LightingEnabled :是否高亮显示

B: 设置图标题标题
<vc:Chart.Titles>
<vc:Title FontSize="16" Text="测试标题" Padding="6"/>
</vc:Chart.Titles>
C:固定设置图例样式和图例颜色(图例一般根据数据自动生成)
<vc:Chart.Legends >
<vc:Legend Margin="0,9,-52,0" Height="148" VerticalAlignment="Top" HorizontalAlignment="Right" Width="44" >
<vc:Legend.Template>
<ControlTemplate>
<!—图例样式—>
</ControlTemplate>
</vc:Legend.Template>
</vc:Legend>
</vc:Chart.Legends>
DataSeries:数据集
RenderAs: 设置图表显示类型,(枚举值) 设置如:RenderAs = RenderAs.Spline
LabelEnabled 是否显示图表中的文本,文本显示样式LabelStyle="Inside" [LabelStyle=LabelStyles.Inside] 表示文字内嵌 LabelText = "#YValue" //设置
Bevel 是否斜面显示
在RenderAs 设置为Spline时
MarkerType可以设置 节点样式如实例 中的第六个

DataPoint 数据点
A: Title 文本 ,ValueFormatString:XValue数据格式化,IntervalType 间隔方式(枚举值),Interval 间隔值
<vc:Chart.AxesX>
<vc:Axis Title="Month" ValueFormatString="d/MMM" IntervalType="Months" Interval="1">
<vc:Axis.Grids>
<vc:ChartGrid Interval="0.2" InterlacedColor="#0Ae66e6e" />
</vc:Axis.Grids>
</vc:Axis>
</vc:Chart.AxesX>
Logarithmic:y轴刻度对数启用,LogarithmBase:对数基数, Prefix设置y轴文本前缀
<vc:Chart.AxesY>
<vc:Axis Interval="1" Title="Market Share" Logarithmic="True" LogarithmBase="5" LineThickness="0">
<vc:Axis.Grids>
<vc:ChartGrid Interval="0.2" InterlacedColor="#0Ae66e6e" />
</vc:Axis.Grids>
</vc:Axis>
</vc:Chart.AxesY>
具体样式参看第三个图
B: 数据格式化显示

XValue的值格式化:
在DataSeries中使用XValueFormatString格式化文本,显示结果控制显示的是鼠标放上去后tooltips显示的值的文本样式;如下图 XValueFormatString=”hh:mm:ss”
在如下代码中设置 控制的是 X轴文本显示样式 如下图
<vc:Chart.AxesX>
<vc:Axis IntervalType="Hours" Title="Hours" ValueFormatString="hh:mm tt"/>
</vc:Chart.AxesX>

原文地址:https://www.cnblogs.com/net_haibo/p/4747229.html