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. Code Tried to bond as a separate series, but still is not working. Is X Axis a way to group group so that the bar is in the same line? Add 1 example: So the key is that for all the bars in the same row,
List
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
chChart.Series ["Series1"]. Chart Type = SeriesChartType.RangeBar; chChart.Series ["Series1"]. Points. DataBind (dt. default view, "number", "start time, stop time", "tooltip = name, label = name");
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; }
Note - When using custom labels, only one value is shown for each x axis label. 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 .
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}});
XValue should be the same (double?).
Comments
Post a Comment