T O P I C R E V I E W |
jerryc |
Posted - 27 Jul 2012 : 10:50:30 Can you tell me how to turn on the Legend for your example "ScrollApplication1'? |
1 L A T E S T R E P L I E S (Newest First) |
quinncurtis |
Posted - 27 Jul 2012 : 12:48:31 There is no simple toggle to turn on a legend. Legends must be built using the StandardLegend class. Use of that class is described in the QCChart2D Charting manual. All of the examples using it are found in the Quinn-Curtis\DotNet\QCChart2D\Visual CSharp\Examples folder (or Quinn-Curtis\DotNet\QCChart2D\Visual Basic\Examples for VB). A simple example for the ScrollApplication1 program would be:
// Horizontal Legend at bottom
Font legendFont = new Font("SansSerif", 12, FontStyle.Bold); ChartAttribute legendAttributes = new ChartAttribute(Color.Black, 1, 0); legendAttributes.SetLineFlag(false); StandardLegend legend = new StandardLegend(0.1, 0.95, 0.7, 0.3, legendAttributes, StandardLegend.HORIZ_DIR); legend.AddLegendItem("Temp 1", ChartObj.LINE, lineplot1, legendFont); legend.AddLegendItem("Temp 2", ChartObj.LINE, lineplot2, legendFont); chartVu.AddChartObject(legend);
or
// Vertical Legend in upper right Font legendFont = new Font("SansSerif", 12, FontStyle.Bold); ChartAttribute legendAttributes = new ChartAttribute(Color.Black, 1, 0); legendAttributes.SetLineFlag(false); StandardLegend legend = new StandardLegend(0.8, 0.15, 0.3, 0.3, legendAttributes, StandardLegend.VERT_DIR); legend.AddLegendItem("Temp 1", ChartObj.LINE, lineplot1, legendFont); legend.AddLegendItem("Temp 2", ChartObj.LINE, lineplot2, legendFont); chartVu.AddChartObject(legend); |
|
|