Adding Data to the OpenFlashChart control

Page 1

To add data we need to set an attribute on the OpenFlashChart called URL. For this example I will set this attribute in the code behind: I have told the control that the data.aspx will be output sending the data for the control:



We now need to add a new page called data.aspx to the project. Enter the code behind and import OpenFlashChart. Then dim a new graph in the Page_Load, your data code behind should now look like this:



Now we will just write some static data in the code behind.



First we set the type of chart we were going to add. I set up the labels for the X axis of the chart for each day of the week. I then decided that I only wanted the Y axis to scale to 50. I used a hash table to store some static data. After the hash table was loaded, I added it to my Chart Data (which I defined earlier as a bar chart). You can add additional bars by adding additional chart data. Last I added my bar chart to the graph.



Your chart should look similar to mine. You now can experiment with changing all kinds of attributes of the chart or adding additional data to the chart.

Page 1