Hello all,
I am trying to learn the .NET 3.5 Chart control, and I'm having some problems. As I said in the title, the data won't display on the chart. I generate a DataTable with data as follows:
Month Fund7206 Fund7208 Fund7624 Fund 7642
1/2010 7245.05 2163993.18 19144.53 0
2/2010 1023294 2051675.46 156709.35 386550.15
3/2010 152365.32 622951.55 21541.41 1864914.85
4/2010 -4174.79 365628.92 6753.26 2452248.74
5/2010 -90.43 310245.35 18284.98 1717070.72
6/2010 0 75279.6 131267.38 1917728.54
7/2010 72.6 48303.17 11692.61 2248545.48
8/2010 676993.72 729642.44 -300503.7 631067.89
Then I create a chart:
Dim Chart1 As New Charting.Chart
Me.Controls.Add(Chart1)
Chart1.Top = 5
Chart1.Left = 5
Chart1.Width = 1000
Chart1.Height = 600
I assign the view of this table to the chart's DataSource like so:
Chart1.DataBindTable(dtAgy.AsDataView, "Month")
I get no errors, but the chart is blank. As in, completely white, not even the axes, grids or anything appear.
Now, if I add the chart to the form at design-time, then do the data assignment, it chart populates and shows the data, grids, etc.
I really need this to be dynamic though. My users could choose anything from 1 to 100+ charts to be generated, and the size of the list of charting candidates fluctuates. So I can't just add 100 chart controls at design-time and use them as needed. I need to be able to add charts dynamically, at run-time.
So, has anybody ever used this control and run into this issue? Know how to fix/workaround it?
I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
I am trying to learn the .NET 3.5 Chart control, and I'm having some problems. As I said in the title, the data won't display on the chart. I generate a DataTable with data as follows:
Month Fund7206 Fund7208 Fund7624 Fund 7642
1/2010 7245.05 2163993.18 19144.53 0
2/2010 1023294 2051675.46 156709.35 386550.15
3/2010 152365.32 622951.55 21541.41 1864914.85
4/2010 -4174.79 365628.92 6753.26 2452248.74
5/2010 -90.43 310245.35 18284.98 1717070.72
6/2010 0 75279.6 131267.38 1917728.54
7/2010 72.6 48303.17 11692.61 2248545.48
8/2010 676993.72 729642.44 -300503.7 631067.89
Then I create a chart:
Dim Chart1 As New Charting.Chart
Me.Controls.Add(Chart1)
Chart1.Top = 5
Chart1.Left = 5
Chart1.Width = 1000
Chart1.Height = 600
I assign the view of this table to the chart's DataSource like so:
Chart1.DataBindTable(dtAgy.AsDataView, "Month")
I get no errors, but the chart is blank. As in, completely white, not even the axes, grids or anything appear.
Now, if I add the chart to the form at design-time, then do the data assignment, it chart populates and shows the data, grids, etc.
I really need this to be dynamic though. My users could choose anything from 1 to 100+ charts to be generated, and the size of the list of charting candidates fluctuates. So I can't just add 100 chart controls at design-time and use them as needed. I need to be able to add charts dynamically, at run-time.
So, has anybody ever used this control and run into this issue? Know how to fix/workaround it?
I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!