This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I would like to display the data value when I mouse over a line series graph. I notice there is a ToolTipBinding property which I am hoping I can use to bind to the data value but would it be possible for you to provide me with an example of how this can be done? Regards, Kamal |
|
|
Hello Kamal The ToolTipBinding property is used in conjunction with data point symbols. This property lets you specify a binding that will be used on each data point to display data in a tooltip. First you'd want to display each data point as a symbol by setting the SymbolStyle property I described to you in your previous post. In the most basic case, you can set the ToolTipBinding to be "{Binding}". This will cause the tooltip of each data point symbol to display the raw data of that point. Or you could specify a property in the binding, for example if you are using Point objects for you data, you could set the ToolTipBinding to be "{Binding Y}" so that the tooltips display the Y value of each point. Or if you have your own custom data point objects, you could point the binding to a property on those objects - this is very useful if you have an additional property on your model objects that aren't directly related to plotting the data. Alternatively, if you want "tool tips" to be displayed at any point along a line - not just the data point symbols - then you could use a custom foreground element as seen in the SampleExplorer. To see this in action run up the SampleExplorer project and go to Charts->Line Chart. Move the mouse over the chart to see data annotations appear on all lines at the mouse X position. The code to achieve this is provided free which can be found in the Demos/Charts/Features folder in the SampleExplorer source directory. The files you will need are TrakingElement.cs and ChartValueDisplay.cs. Let me know if you have any questions about any of this. Jason Fauchelle |
|
|
Hi Jason, This post says the tooltipbinding is only for symbols - mean scatter series. My question is on Line Series: how do we set the tooltips for the line series? and I don't want to put any symbol even the faked one to the line series, since it may slow down the performance. I tried the following and it does not work at all:
X is the datapoint's X value. Any simple example will help. If I apply the following to the LineSeries's style, how much slowdown the performace will suffer if I have a lot of lines?
Thanks Gordon |
|
|
Hello Gordon Setting the ToolTip on each line will have very little impact on the performance even with lots of lines. Note that WPF tooltips are very static and stiff. They do not move with the mouse as you move over an element. If you want a more dynamic annotation, I'd recommend that you use the TrackingElement class which I described in my first forum post above. Samples of using this class is available in most of the line series demos in the Sample Explorer. The code for the class itself is also available in the Sample Explorer. Since all the source code is available, you can customize the logic if you need to. Jason Fauchelle |
|