Adding a horizontal line to a Silverlight Toolkit column chart

别等时光非礼了梦想. 提交于 2019-12-05 16:36:04

By the way I have created a more generic chart which works with any kind of series (Column, Bar, StackedColumn etc) and displays any value as a line.

I've explained the usage of this chart in my blog post.

Source code can be downloaded here.

You can set a Line's Stretch="Fill" to make it stretch the whole length

As for aligning it along the Y-Axis, I would try either binding to the Y1/Y2 properties, or putting the line in a Canvas or Grid control which holds both the Chart and the Line and binding Canvas.Top to set its location

to get the y location of the line you would need to call the GetPlotAreaCoordinate method on your Y axis

chart.Axes[1].GetPlotAreaCoordinate(value) // you could name your axis if you like.

I ended up implementing something based on the techniques described here http://www.scottlogic.co.uk/blog/colin/2009/03/adding-a-location-crosshair-to-silverlight-charts-again/.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!