beltrams Posted May 13, 2011 Report Share Posted May 13, 2011 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. Simone Quote Link to comment Share on other sites More sharing options...
JuanC Posted May 13, 2011 Report Share Posted May 13, 2011 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;chart1.AxisY.DataFormat.Decimals= 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 (objectsender, EventArgs e){ if((chart1.AxisY.Max - chart1.AxisY.Min) < 2) chart1.AxisY.Labels.Decimals = 2;} JuanC Quote Link to comment Share on other sites More sharing options...
beltrams Posted May 16, 2011 Author Report Share Posted May 16, 2011 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" /> </MultiBinding> 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.