I'm using wpf and livecharts to wpf app. I want to set minimum distances at but can't find out options.
Because livechart automatically resize axis X and Y to fit, sometimes the chart is too crowded to see. So I want to set minimum distance between points and columns. panning will solve browsing part.
But problem is, I can't find out setting option. I've checked chart, axis and series options and tried some options. width, minwidth, margin, padding.. but all options didn't work.
My last option is make page and let user change page to see. But if user want to compare another page's value, it is not easy. So I want to avoid it.
Is there any option I'm missing? Please help.
You have to zoom in and out. To do this you have to manually assign an axis to the chart. Axis exposes properties like MinValue
and MaxValue
. You can use this values to zoom in (e.g. MaxValue
< max data x value) or out (e.g. MaxValue
> max data x value). MinValue
and MaxValue
control the visible section (or range). You would need to pan the graph to view other ranges.
To enable panning you have to set the Zoom
property on the chart to the axis you wish to pan:
<wpf:CartesianChart Zoom="Xy">
<wpf:CartesianChart.AxisX>
<wpf:Axis MinValue="0" MaxValue="20" />
</wpf:CartesianChart.AxisX >
<wpf:CartesianChart.Series>
<wpf:LineSeries Title="Values" Values="{Binding DataValues}" />
</wpf:CartesianChart.Series>
</wpf:CartesianChart>