c# - MS Chart X Axis label repeated - showing multiple points for a single item [Range Bar] -


I have created a rangebar ms chart control that binds to the dataset. This figure is based on the following list data. The problem is that X-axis is showing several points for the same item with a different category.

List Enter image details here
MS Chart
The first column of the X-axis indicates the column and the value of the Y axis is the third and fourth columns. "DT" is the data name

Enter image details here

Code

  chChart.Series ["Series1"]. Chart Type = SeriesChartType.RangeBar; chChart.Series ["Series1"]. Points. DataBind (dt. default view, "number", "start time, stop time", "tooltip = name, label = name");   

Tried to bond as a separate series, but still is not working.

  var IETable = (dt.ComponentModel.ilistSource as the system) .GetList (); ChChart.DataBindCrossTable (IETable, "number", "number", "start time, time off", ""); Foreign Currency (Series sr in chChart.Series) {sr.ChartType = SeriesChartType.RangeBar; Sr.YValueType = Chart Duplicate time; Sr.XValueType = ChartValueType.String; }   

Is X Axis a way to group group so that the bar is in the same line?
Note - When using custom labels, only one value is shown for each x axis label.

Enter image details here

Add 1 series to chart. Then for the series, make sure YValuesPerPoint = 2 . Add new datapoint so that line shows the line XValue (for example line ABC1, XValue = 1 and line ABC2, XValue = 2 . You can set the label of that axis (in this case 'ABC1' and 'ABC2') for DataPoint.AxisLabel . Then for Yiwal . code>>, you separate the value comma, for example 1,2 or 720 .

example:

  series ["Series 1"] point.ed (new data point) {Axislabil = "ABC 1", Excl = 1, wavelength = new double [] {2,5}});] .point.ed (new data point) {Axislabil = "ABC1", excl = 1, wavels = new double [] {6, 7}}); Series ["Series 1"]. () {AxisLabel = "ABC1", XValue = 1, YValues ​​= new double [] {9,10}}); ChChart.Series ["Series1"]. Points. Add (New DataPoint) {AxisLabel = "ABC2", XValue = 2, YValues ​​= New Double [] {3,6}}); chChart.Series ["Series1"]. Points. Add (new datapoint () {AxisLabel = "ABC 2", preview = 2, wavelength = new double [] {7,8}});   

So the key is that for all the bars in the same row, XValue should be the same (double?).

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -