Difference between revisions of "ChartView"
From Jeremie Leroy - XOJO Controls Wiki
(→Version 1.1 - Not Released) |
m (35 revisions imported) |
||
(29 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
Line 74: | Line 73: | ||
|- | |- | ||
|width=50%|{{Method | name=ExportAsPicture | description= | returntype=Picture | newinversion=}} | |width=50%|{{Method | name=ExportAsPicture | description= | returntype=Picture | newinversion=}} | ||
− | |width=50%|{{Method | name= | + | |width=50%|{{Method | name=setDefaultColors | params=Assigns Palette As Integer | description= | newinversion=}} |
|- | |- | ||
|width=50%|{{Method | name=Init | params=Labels As Boolean = False, Marks As Boolean = False, DataLabel As Boolean = False | description= | newinversion=}} | |width=50%|{{Method | name=Init | params=Labels As Boolean = False, Marks As Boolean = False, DataLabel As Boolean = False | description= | newinversion=}} | ||
Line 105: | Line 104: | ||
==History== | ==History== | ||
− | === | + | Read on [[ChartView.History|History page]] |
− | + | ||
− | * | + | ==Notes== |
− | + | ||
− | *** | + | ===Defining the default colors=== |
− | + | The default colors for each Chartserie is entirely customizable. | |
− | + | ||
+ | *The quick way: | ||
+ | In the ChartView.open event use one of the following lines: | ||
+ | |||
+ | <source lang="realbasic"> | ||
+ | me.setDefaultColors = me.PaletteGoogle | ||
+ | me.setDefaultColors = me.PaletteOffice2010 | ||
+ | me.setDefaultColors = me.PaletteWindows8 | ||
+ | </source> | ||
+ | |||
+ | |||
+ | *The advanced way: | ||
+ | In the ChartView.open event: | ||
+ | |||
+ | <source lang="realbasic"> | ||
+ | Redim me.DefaultColors(-1) //Deleting all DefaultColors | ||
+ | |||
+ | me.DefaultColors.append &cFF0000 //red | ||
+ | me.DefaultColors.append &c00FF00 //green | ||
+ | me.DefaultColors.append &cFF0000 //purple | ||
+ | ... | ||
+ | If f is Nil or f.Exists = False then | ||
+ | MsgBox("Ressource files are missing") | ||
+ | Return | ||
+ | End If | ||
+ | test=250 | ||
+ | </source> | ||
+ | |||
+ | ===Changing display options when loading Data=== | ||
+ | When using one of the following functions: | ||
+ | *LoadFromCSV | ||
+ | *LoadFromDB | ||
+ | *LoadFromListbox | ||
+ | |||
+ | The ChartView automatically refreshes the display.<br> | ||
+ | If you need to edit the display before refreshing, you can use the '''Freeze''' property to prevent refreshing: | ||
+ | |||
+ | <source lang="realbasic"> | ||
+ | me.Freeze = True //This freezes the display until you unfreeze it | ||
+ | me.LoadFromListbox(Listbox1) | ||
+ | |||
+ | //Edit the ChartSerie colors | ||
+ | For i = 0 to Ubound(me.Series) | ||
+ | |||
+ | If i = 0 then | ||
+ | me.Series(i).FillColor = &cFF0000 | ||
+ | Elseif i = 1 then | ||
+ | me.Series(i).FillColor = &c00FF00 | ||
+ | Elseif i = 2 then | ||
+ | me.Series(i).FillColor = &c0000FF | ||
+ | |||
+ | //And so on for all series | ||
+ | End If | ||
+ | Next i | ||
+ | |||
+ | //Edit the Y Axis | ||
+ | me.Axes(1).MinimumScale = 10 | ||
+ | |||
+ | me.Freeze = False //Unfreeze the display | ||
+ | |||
+ | If me.Animate then | ||
+ | me.StartAnimation() | ||
+ | else | ||
+ | me.Redisplay() | ||
+ | End If | ||
+ | </source> | ||
+ | |||
+ | ==See Also== | ||
+ | |||
+ | [[ChartAxis]], [[ChartHelpTag]], [[ChartLabel]], [[ChartLine]], [[ChartMarkLine]], [[ChartPlot]], [[ChartSerie]] classes. | ||
+ | |||
+ | [[Category:ChartView]] | ||
+ | [[Category:XOJO Controls]] |
Latest revision as of 13:21, 6 August 2015
Events |
AnimationFinished |
GetFillPicture |
GetHelpTag |
Open |
Methods | |
AddMark | Redisplay |
AddSerie | setDataLabel |
ExportAsPicture | setDefaultColors |
Init | setTransparency |
LoadFromCSV | StartAnimation |
LoadFromDB | ToCSV |
LoadFromListbox | |
Redisplay |
Shared Methods |
Register |
Contents
History
Read on History page
Notes
Defining the default colors
The default colors for each Chartserie is entirely customizable.
- The quick way:
In the ChartView.open event use one of the following lines:
me.setDefaultColors = me.PaletteGoogle me.setDefaultColors = me.PaletteOffice2010 me.setDefaultColors = me.PaletteWindows8
- The advanced way:
In the ChartView.open event:
Redim me.DefaultColors(-1) //Deleting all DefaultColors me.DefaultColors.append &cFF0000 //red me.DefaultColors.append &c00FF00 //green me.DefaultColors.append &cFF0000 //purple ... If f is Nil or f.Exists = False then MsgBox("Ressource files are missing") Return End If test=250
Changing display options when loading Data
When using one of the following functions:
- LoadFromCSV
- LoadFromDB
- LoadFromListbox
The ChartView automatically refreshes the display.
If you need to edit the display before refreshing, you can use the Freeze property to prevent refreshing:
me.Freeze = True //This freezes the display until you unfreeze it me.LoadFromListbox(Listbox1) //Edit the ChartSerie colors For i = 0 to Ubound(me.Series) If i = 0 then me.Series(i).FillColor = &cFF0000 Elseif i = 1 then me.Series(i).FillColor = &c00FF00 Elseif i = 2 then me.Series(i).FillColor = &c0000FF //And so on for all series End If Next i //Edit the Y Axis me.Axes(1).MinimumScale = 10 me.Freeze = False //Unfreeze the display If me.Animate then me.StartAnimation() else me.Redisplay() End If
See Also
ChartAxis, ChartHelpTag, ChartLabel, ChartLine, ChartMarkLine, ChartPlot, ChartSerie classes.