ChartView anybody?

Hi,
I’m using Jeremy Leroy’s ChartView, pretty stuff.

I use the following code to initialize a bar chart:

[code] Sub InitGraph(totalValue as Integer, geringValue as Integer, normalValue as Integer, highValue as Integer, unakzeptableValue as Integer)
'generate graph

mainWindow.ChartView1.DoubleBuffer = True

dim aSerie as new ChartSerie
dim bSerie as new Chartserie
dim cserie as new Chartserie
dim dSerie as new Chartserie

mainWindow.ChartView1.Type = mainWindow.ChartView1.TypeBar
mainWindow.ChartView1.EnableSelection = True
mainWindow.ChartView1.setDefaultColors = mainWindow.ChartView1.PaletteGoogle

mainWindow.ChartView1.Title = “Prüfungen im Datenbank”

aSerie.setvalues = array( geringValue)

bSerie.setvalues = array( normalValue)

cSerie.setvalues = array(highValue)

dSerie.setvalues = array(unakzeptableValue)

aSerie.Title = “Gering Risiko”
bSerie.Title = “Normales Risiko”
cSerie.Title = “Hoch Risiko”
dSerie.Title = “Unakzeptabel Risiko”

mainWindow.ChartView1.AddSerie(aSerie)
mainWindow.ChartView1.AddSerie(bSerie)
mainWindow.ChartView1.AddSerie(cSerie)
mainWindow.ChartView1.AddSerie(dSerie)

mainWindow.ChartView1.LegendPosition = mainWindow.ChartView1.PositionRight

mainWindow.ChartView1.setDataLabelFormat("###")
mainWindow.ChartView1.Axes(0).Title = “Prüfungen”
'mainWindow.ChartView1.Refresh
mainWindow.ChartView1.Redisplay

End Sub
[/code]

But what do I change if I want to change let’s say the Value of aSerie and display the results? I tried to call the same function with changed parameters but it add’s the values as new series, so I end up with a double chart (or triple…). How do I change the values for an existing chart?

Thanks.

Try using:

MainWindow.ChartView1.Freeze = true

Then change any data, then:

MainWindow.ChartView1.Freeze = false MainWIndow.ChartView1.refresh MainWIndow.ChartView1.Redisplay

Yes but HOW to change the data?