c# - Chart control: Design messed Up after clearing and re-adding Y-Values -


The day was struggling with this. I have three series on a chart that looks like this. Note: I am using vanof control.

They are being added on the basis of input from the calculation. I am using this code to add value to each series.

  this.chart1.Series ["green"]. Points. AddY (greenvalue); This.chart1.Series ["totalsaving"] Points.AddY (totalsavingvalue). This.chart1.Series ["blue"] Points.AddY (bluevalue).  

I have set series properties like this. Both green and totalsaving are set to StackedColumn, the blue chart is set to the column for type.

Enter details of the image here

I started then To do is a button that brings the user back to the input field and then I am using this code to clear the series values ​​on the start code.

  chart 1. Series ["totaling"]. Points. clear (); Chart1.Series ["green"] Points.Clear () .; Chart1.Series ["blue"] Points.Clear () .;  

The same calculation click above is being calculated for the calculation of the data of the series and population. The problem occurs when I calculate the values ​​after calculating the values Clicking on, missing total savings and green color. Only blue is shown

Am I trying to clean up the values, so am I doing something wrong so that I can count again?

OK, edit, comments, answer our question and enough data from joim.me session is frozen.

  • You have twisted the display by adding an extra data point to the blue series in the designer
  • This point remains on slot 1, but its Price is invisible as = 0.
  • This pushes the next point in the slot 2 in the chain
  • After clearing the issue it has gone and the display no longer works.
  • Due to the disappearance of two columns, probably due to hard coded width.

You have several paths to follow:

  • Rebuild additional points with value = 0 before adding actual data (Recommended No)

  • Do not add additional points at the first place but using points instead of points, each point can be placed in your slot. X with slot with x

  • Do not clear the digits but update your prices using the SetValueY method. After all the three data points, you have been assigned your new values, which you need to call chart 1. Investigate () to show it

Foremost The easiest style of all those qualities, which are deeply buried inside the property's wire (!), You can add all three points in the designer and style And decide to polish your and just update your y-values ​​like this:

  chart1 series ["green"] SetValueY (greenvalue) Chart1.Series ["totalsaving"] SetValueY (totalsavingvalue). Chart1.Series ["blue"] SetValueY (bluevalue). Chart1.Invalidate ();  

The option is yours, but in any case, I recommend setting the proper X value, put it in code or desginer.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -