2.1.14.1.2 plot_sparkline
Contents
Description
Add Sparkline to column
Syntax
DataPlot plot_sparkline( Worksheet & wks, int nCol, GraphPage & gp, int nType, LPCSTR lpcszTemplate = NULL, bool bUseX = false, bool* pbChangeDataOnly = NULL, bool bUndo = false )
Parameters
- wks
- [input] Specify the worksheet to manipulate
- nCol
- [input] the column to add sparkline
- gp
- [input/output] If a valid graph is input, a copy of that graph will be used to plot sparkline. Upon output, the sparkline graph will be returned.
- nType
- [input] Plot type, should be one of these: 0 = Line, 1 = Histogram, 2 = Box
- lpcszTemplate
- [input] Specify the template that will be used for the sparkline. Default will use nType relative template. Template will be used if input gp is invalid
- bUseX
- [input] Specify whether to plot the Y data against the associated X dataset or row numbers.
- pbChangeDataOnly
- [output] return whether only change dataset in the sparkline
- bUndo
- [input] undoable or not
Return
the sparkline data plot
Examples
EX1
void plot_sparkline_ex(int nC) { Worksheet wks = Project.ActiveLayer(); if(!wks) { out_str("no wks"); return; } GraphPage gp; DataPlot dp = plot_sparkline(wks, nC, gp, 0); if(gp) { DWORD dwCntrl = EMBEDGRAPH_IN_LABELS | EMBEDGRAPH_HIDE_AXES | EMBEDGRAPH_HIDE_LEGENDS | EMBEDGRAPH_HIDE_SCALES | EMBEDGRAPH_SPARKLINE | EMBEDGRAPH_HIDE_TEXT_OBJS; wks.EmbedGraph(RCLT_SPARKLINE, nC, gp, dwCntrl); } }
Remark
See Also
Header to Include
origin.h