Jump to content
Software FX Community

Step in a Line chart


Recommended Posts

Dear Forum,

I have a line chart where I set ForceZero to False so that the chart is in all the plot area.

This was working ok for me bbut know, I have a problem for a particular set of data.

The value of the chart are in this case vary close, for example : 14.945, 14.95, 14.954, 14.965 etc.

The chart is diplayed correctly but I have no clue on the Y axis about the values (see screenshoot 1).

I have tried to set the Step to 0.01, this do the trick for this particular data (see screenshoot 2) but it is not accettable for other data (for example if I have value range between 0 and 100!).

Do you have any suggestion on this? Id it is possible to show always min and max or some line or something else to give a blue about the values?

Thanks for any hint on this.


Link to comment
Share on other sites

Instead of setting the step you might want to try changing the number of decimals used in the Y axis.

chart1.AxisY.Labels.Decimals = 2;
= 3;

The first line would only affect the axis labels while the second would affect things like tooltips. If the data range is variable you could do something like this

chart1.DataBound += new EventHandler(OnChartBound);
private void OnChartBound (object
sender, EventArgs e)
((chart1.AxisY.Max - chart1.AxisY.Min) < 2)
  chart1.AxisY.Labels.Decimals = 2;



Link to comment
Share on other sites

Is it possible to do something symilar with binding? I have tried a multibinding

<MultiBinding Converter="{StaticResource MinAndMaxConverter}">

<Binding Mode="OneWay" ElementName="test1" Path="Min" />

<Binding Mode="OneWay" ElementName="test1" Path="Max" />


but it seems to be Min and Max don't notify as the converter is called only once (with double.minvalue/maxvalue).

Otherwise, as I dont have code behind, I will need to use an attached behaiour

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...