121
Programmazione (Gambas 2) / gb.chart
« il: 26 Settembre 2009, 10:00:24 »
Ho provato a creare un semplice programmetto di test del componente in questione, ma mi da' errore (null object error). Forse sono un po' arrugginito con gambas!
Il programma è composto da un bottone (che crea il grafico), una form , una drawing area.
Il programma è composto da un bottone (che crea il grafico), una form , una drawing area.
Codice: [Seleziona]
' Gambas class file
PUBLIC SUB _new()
END
PUBLIC SUB Form_Open()
END
PUBLIC SUB Button1_Click()
SetMyChart
END
SUB SetMyChart()
DIM mychart AS Chart
mychart.Headers = ["a", "b", "c"]
mychart[0].Values = [1.0, 2.0, 3.0]
mychart.Title = "Chart test"
mychart.Legend.Visible = TRUE
mychart.Legend.Title = "My legend"
mychart.Type = ChartType.Lines
mychart.Style = ChartStyle.Custom
mychart.Colors.Values = [Color.Yellow, Color.Red, Color.Blue]
mychart.Width = DrawingArea1.ClientHeight
mychart.Height = DrawingArea1.ClientWidth
mychart.Draw
END