This is a migrated thread and some comments may be shown as answers.

xaxis item labeltext for stacked column programatically

1 Answer 62 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 2
Joel asked on 28 Aug 2013, 01:38 PM
I am creating a an htmlchart completely in the code behind.  I utilized one of the demos. 

I now want to extend that chart as a stacked column.  It works well.

Problem I am having is having the x-axis labels showing up.  if I do this, I get an index error

ch1.PlotArea.XAxis.Items.Item(0)...

Since I am declaring each series in the code, and each categoryseriesitem in a row loop, it is not databound in a traditional manner.  The following does not throw an error, but the x-axis label is not visible either
ch1.PlotArea.XAxis.DataLabelsField = "Name"

Any suggestions? This is close to being done, but this is the last piece.

1 Answer, 1 is accepted

Sort by
0
Joel
Top achievements
Rank 2
answered on 28 Aug 2013, 01:52 PM
Please disregard.  I had to add xaxis items within the categoryseriesitem loop and it works fine.

For Each row As DataRow In GetChartDataE().Rows
  ..add categoryseriesitems
 
 ch1.PlotArea.XAxis.Items.Add(row("Name"))
Next
Tags
Chart (HTML5)
Asked by
Joel
Top achievements
Rank 2
Answers by
Joel
Top achievements
Rank 2
Share this question
or