如何使用Chart

实例:

Binding数据源中是一个KeyValuePair对象。可以是Dictionary.

<charting:Chart x:Name="chtSummary" Width="770" Height="400" Title="My Chart Title">
<charting:Chart.TitleStyle>
<Style TargetType="datavis:Title">
<Setter Property="FontSize" Value="28" />
<Setter Property="FontFamily" Value="Arial" />
<Setter Property="Margin" Value="5, 10, 5, 15" />
</Style>
</charting:Chart.TitleStyle>
<charting:Chart.LegendStyle>
<Style TargetType="datavis:Legend">
<Setter Property="Width" Value="0" />
</Style>
</charting:Chart.LegendStyle>
<charting:Chart.Series>
<charting:BarSeries ItemsSource="{Binding}" DependentValuePath="Value" IndependentValuePath="Key" IsSelectionEnabled="True" >
<charting:BarSeries.IndependentAxis>
<charting:CategoryAxis Orientation="Y" AxisLabelStyle="{StaticResource SummaryChartAxisStyle}" />
</charting:BarSeries.IndependentAxis>
</charting:BarSeries>
</charting:Chart.Series>
</charting:Chart>

 

 

如何添加第二个Y坐标

secondary y axis on WPF toolkit chart

 

实例:

On the first serie (ColumnSerie on my example), add this

<DVC:ColumnSeries.DependentRangeAxis >
<DVC:LinearAxis Location="Left" Orientation="Y" />
</DVC:ColumnSeries.DependentRangeAxis>

On the second serie (LineSeries), add this

<DVC:LineSeries.DependentRangeAxis >
<DVC:LinearAxis Location="Right" Orientation="Y" />
</DVC:LineSeries.DependentRangeAxis>

 

如何修改图列的名称

实例:

LineSeries Title=" Monthly Count" is responsible for display the legend text

<wpft:Chart Canvas.Top="80" Canvas.Left="10" Name="mcChart"
Width="400" Height="250"
Background="LightSteelBlue">
<wpft:Chart.Series>
<wpft:LineSeries Title=" Monthly Count"
IndependentValueBinding="{Binding Path=Key}"
DependentValueBinding="{Binding Path=Value}">
</wpft:LineSeries>
</wpft:Chart.Series>
</wpft:Chart>

 

改变DataPointStyle

实例:

<chartingToolkit:Chart Margin="0,12,12,12" Name="chart1">
<chartingToolkit:Chart.Series>
<chartingToolkit:ColumnSeries DependentValuePath="value">
<chartingToolkit:ColumnSeries.DataPointStyle>
<Style TargetType="chartingToolkit:ColumnDataPoint">
<Setter Property="DependentValueStringFormat" Value="{}{0:C0}"/>
</Style>
</chartingToolkit:ColumnSeries.DataPointStyle>
</chartingToolkit:ColumnSeries> </chartingToolkit:Chart.Series>
<chartingToolkit:Chart.Axes>
<chartingToolkit:LinearAxis Orientation="Y" ShowGridLines="False" HorizontalAlignment="Left">
<chartingToolkit:LinearAxis.AxisLabelStyle>
<Style TargetType="chartingToolkit:AxisLabel">
<Setter Property="StringFormat" Value="{}{0:C0}"/>
</Style>
</chartingToolkit:LinearAxis.AxisLabelStyle>
</chartingToolkit:LinearAxis>
</chartingToolkit:Chart.Axes>
</chartingToolkit:Chart>

WPF Tookit Chart的更多相关文章

  1. WPF 开源Chart控件

    控件: Icon URL   Supplier Dynamic Data Display 2009

  2. WPF ToolKit Chart 自定义样式

    1.引用:WPFToolkit.dll, System.Windows.Controls.DataVisualization.Toolkit.dll 2. 页面代码参考如下: <UserCont ...

  3. WPF DevExpress Chart控件多Y轴,指定数据参考的Y轴

    当Chart中有两个及以上的Y轴时,我们就要指明图表中的柱子或折线对应的是哪个Y轴了,这时候需要指明柱子或者折线的dxc:XYDiagram2D.SeriesAxisY属性,来设置对应的Y轴(dxc: ...

  4. WPF DevExpress Chart控件 界面绑定数据源,不通过C#代码进行绑定

    <Grid x:Name="myGrid" Loaded="Grid_Loaded" DataContext="{Binding PartOne ...

  5. WPF DevExpress Chart控件 需要引用的类库

    DevExpress.Charts.v16.1.Core.dll DevExpress.Data.v16.1.dll DevExpress.Mvvm.v16.1.dll DevExpress.Xpf. ...

  6. WPF自定义控件

    一.ImageButton 1.继承ImageButtonButton,添加依赖属性 using System; using System.Windows; using System.Windows. ...

  7. (转)WPF控件开源资源

    (转)WPF控件开源资源 Textbox Drag/Drop in WPFhttp://www.codeproject.com/Articles/42696/Textbox-Drag-Drop-in- ...

  8. 【转】WPF - 第三方控件

    WPF - 第三方控件 目前第三方控件在网上形成巨大的共享资源,其中包括收费的也有免费的,有开源的也有不开源的,合理的使用第三方控件将使项目组的工作事半功倍.比如项目中有些复杂的业务逻辑.有些绚丽的效 ...

  9. WPF 第三方控件

    目前第三方控件在网上形成巨大的共享资源,其中包括收费的也有免费的,有开源的也有不开源的,合理的使用第三方控件将使项目组的工作事半功倍.比如项目中有些复杂的业务逻辑.有些绚丽的效果需要有专门的定制控件才 ...

随机推荐

  1. 发布 Rafy 源码到 GitHub

      最近项目组开始使用 Git 来作为源码管理.我今天就顺便把 Rafy 的源码也迁移到了 github 上,方便大家使用.这是项目的地址:https://github.com/zgynhqf/raf ...

  2. 第三方登录插件.NET版XY.OAuth-CSharp

    XY.OAuth-CSharp GitHub:XY.OAuth-CSharp OSChina:XY.OAuth-CSharp 第三方登录插件.NET版 使用 首先,从NuGet上安装"XY. ...

  3. CodeFirst时使用T4模板(你肯定没用过的笨方法,还望园友指教)

    我们都知道T4模板用于生成相似代码. 在DBFirst和ModelFirst条件下我们很容易从.edmx下获取所有实体类和其名称,并且通过我们定义的模板和某些遍历工作为我们生成所需要的相似代码. 但是 ...

  4. 解决EP拒绝访问注册表Global键的的问题

    问题描述   打开EP站点时出现如下Error: Message: An unhandled error has occurred. To view details about this error, ...

  5. N-Tier Entity Framework开源项目介绍

               N-Tier Entity Framework是一个基于微软Entity Framework的N层.NET解决方案. 并且与以下这此技术点无缝集成了: § WCF RIA Ser ...

  6. SQL Server 索引

    SQL Server 中数据存储的基本单位是页(Page).数据库中的数据文件(.mdf 或 .ndf)分配的磁盘空间可以从逻辑上划分成页(从 0 到 n 连续编号).磁盘 I/O 操作在页级执行.也 ...

  7. 鼠标滑过图片变暗文字链接滑出jQuery特效

    效果体验:http://hovertree.com/texiao/jquery/7.htm HTML文件代码: <!DOCTYPE html> <html xmlns="h ...

  8. 【grunt第二弹】30分钟学会使用grunt打包前端代码(02)

    前言 上一篇博客,我们简单的介绍了grunt的使用,一些基础点没能覆盖,我们今天有必要看看一些基础知识 [grunt第一弹]30分钟学会使用grunt打包前端代码 配置任务/grunt.initCon ...

  9. file_put_contents 错误:failed to open stream: Invalid argument 一种原因

    今天在测试nilcms系统的时候,出现了一个报错,导致缓存无法更新: file_put_contents(C:\UPUPW_AP5.4\vhosts\d.tv\NilCMS_APP\include_r ...

  10. Mvc传值

    提到Mvc传值我想大多数人想到的是ViewBag,自3.0之后在控制器与视图之间传值绝大多数传值用到的对象就是ViewBag.对于笔者以前做过的一些小的项目,貌似不需要考虑什么,但对于稍微大些的项目涉 ...