Desktop chart refresh

I have a little issue, and hopefully someone can point me in the right direction.

There are 3 charts that have that, if someone requests, will add more datapoints to the chart or charts depending.

When I run the program, the first time I run it, the datapoints and labels show up just fine. Run it a second time with the chart window open and the x axis labels update just fine, but there is are no new datapoints.

Should I close the window and reopen it, make a chart request, I see all of the datapoints, and x axis labels.

I have tried to do a window.refresh, window.chart1.Refresh but they do not seem to work.

A debug run is showing me that the data is there just fine, and yet it doesn’t show up in my chart.

Any ideas?



Some code or example project showing how it is done would help to better understand what could be going on…

Hi Javier:

Here is the code that is called with the menu handler:

var thisIsTheAmountRemainingOnMortgageArray() as Double
var thisIsTheAmountRemainingOnMortgageArrayDS as New ChartLinearDataset("Amount Remaining On Mortgage", Color.Brown,False, thisIsTheAmountRemainingOnMortgageArray)
ChartWindow.Chart2.Mode = DesktopChart.Modes.Line

var chartOfAmountRemainingOnMortgageRowCount as Integer
var remainingMortgageXAxisVariable as integer

//now we go through the column of interest and add the points
// but check to see if there are any points to add.

if newMortgageAmortizationProgramWindow.ListBox1.RowCount = 0 then
  MessageBox "You need some data first"
  for chartOfAmountRemainingOnMortgageRowCount = 0 to (newMortgageAmortizationProgramWindow.ListBox1.RowCount - 1) step app.chartStepVariable
    thisIsTheAmountRemainingOnMortgageArray.Add CDbl(newMortgageAmortizationProgramWindow.ListBox1.CellTextAt(chartOfAmountRemainingOnMortgageRowCount,4))
  next chartOfAmountRemainingOnMortgageRowCount
end if

for remainingMortgageXAxisVariable = 0 to (newMortgageAmortizationProgramWindow.ListBox1.RowCount -1) step app.chartStepVariable
  ChartWindow.Chart3.AddLabels Array(newMortgageAmortizationProgramWindow.ListBox1.CellTextAt(remainingMortgageXAxisVariable,0))
next remainingMortgageXAxisVariable


Return True