/***************************************************************************** * * Copyright (c) 1999, KL GROUP INC. All Rights Reserved. * http://www.klgroup.com * * This file is provided for demonstration and educational uses only. * Permission to use, copy, modify and distribute this file for * any purpose and without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all * copies, and that the name of KL Group not be used in advertising * or publicity pertaining to this material without the specific, * prior written permission of an authorized representative of * KL Group. * * KL GROUP MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY * OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE, OR NON-INFRINGEMENT. KL GROUP SHALL NOT BE LIABLE FOR ANY * DAMAGES SUFFERED BY USERS AS A RESULT OF USING, MODIFYING OR * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. * *****************************************************************************/ //--------------------------------------------------------------------------- #include #pragma hdrstop #include #include "datastyl1.h" #include "oc_color.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "OlectraChart2D_TLB" #pragma resource "*.dfm" TfrmDataStyles *frmDataStyles; //--------------------------------------------------------------------------- __fastcall TfrmDataStyles::TfrmDataStyles(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TfrmDataStyles::mnuExitClick(TObject *Sender) //End the program. { exit(0); } //--------------------------------------------------------------------------- void __fastcall TfrmDataStyles::Chart2D1MouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) //When the left-mouse button is pressed over a data point or the // series reference in the legend, make changes to the selected point or series. { long Series, Point, Distance; RegionConstants Region; long NewSymbol, NewPattern, NewWidth; int iLoop; Randomize; Variant vCG = Chart2D1->ChartGroups; Variant vCG1 = vCG.OlePropertyGet("Item", 1); Variant vPStyles = vCG1.OlePropertyGet("PointStyles"); Variant vLStyles = vCG1.OlePropertyGet("LegendStyles"); //Find out where the mouse is Region = (RegionConstants)(short)vCG1.OleFunction("CoordToDataIndex", (long)X, (long)Y, oc2dFocusXY, &Series, &Point, &Distance); //If the Left Mouse Button was pressed then make some style changes if (Button == mbLeft) { //If the mouse is over the ChartArea then, update the selected data point if (Region == oc2dRegionInChartArea) { //If we are over a Data Point in the Chart if ((Series > 0) && (Point > 0) && (Distance <= 5)) { //Randomly select a Symbol Type, Pattern and Symbol Width NewSymbol = random(16) + 1; NewPattern = random(17) + 1; NewWidth = (random(18) + 1) + 7; //If the Bubble Chart Type is selected, use the the logical Series if (rbTypeBubble->Checked == true) Series = ((Series - 1) * 2) + 1; //Depending on what Chart Type is active, update the appropriate Data Style Item if ((rbTypeBar->Checked == True) || (rbTypePie->Checked == True) || (rbTypeStackedBar->Checked == True)) { Variant vStyle = vPStyles.OleFunction("Add", Series, Point); Variant vFill = vStyle.OlePropertyGet("Fill"); vFill.OlePropertySet("Pattern", NewPattern); } else { if ((rbTypeHLOC->Checked == true) || (rbTypeCandle->Checked == True)) { Variant vStyle = vPStyles.OleFunction("Add", Series, Point); Variant vSymbol = vStyle.OlePropertyGet("Symbol"); vSymbol.OlePropertySet("Size", NewWidth); } else { Variant vStyle = vPStyles.OleFunction("Add", Series, Point); Variant vSymbol = vStyle.OlePropertyGet("Symbol"); vSymbol.OlePropertySet("Shape", NewSymbol); } } } } //If the mouse is over the Legend then, update the selected series if (Region == oc2dRegionInLegend) { if ((Series > 0) && (Distance <= 5)) { //Batch all the updates to the Chart so all the changes occur at once Chart2D1->IsBatched = true; //Randomly select a Symbol Type, Pattern and Symbol Width NewSymbol = random(16) + 1; NewPattern = random(17) + 1; NewWidth = (random(18) + 1) + 7; //If the Bubble Chart Type is selected, use the the logical Series if (rbTypeBubble->Checked == true) Series = ((Series - 1) * 2) + 1; //Depending on what Chart Type is active, update the appropriate // Data Styles for the whole series for (iLoop = 1; iLoop <= 5; ++iLoop) { if ((rbTypeBar->Checked == True) || (rbTypePie->Checked == True) || (rbTypeStackedBar->Checked == True)) { Variant vStyle = vPStyles.OleFunction("Add", Series, iLoop); Variant vFill = vStyle.OlePropertyGet("Fill"); vFill.OlePropertySet("Pattern", NewPattern); } else { if ((rbTypeHLOC->Checked == true) || (rbTypeCandle->Checked == True)) { Variant vStyle = vPStyles.OleFunction("Add", Series, iLoop); Variant vSymbol = vStyle.OlePropertyGet("Symbol"); vSymbol.OlePropertySet("Size", NewWidth); } else { Variant vStyle = vPStyles.OleFunction("Add", Series, iLoop); Variant vSymbol = vStyle.OlePropertyGet("Symbol"); vSymbol.OlePropertySet("Shape", NewSymbol); } } } //Now update the Data Style for the Legend itself if ((rbTypeBar->Checked == True) || (rbTypePie->Checked == True) || (rbTypeStackedBar->Checked == True)) { Variant vLStyle = vLStyles.OlePropertyGet("Item", Series); Variant vFill = vLStyle.OlePropertyGet("Fill"); vFill.OlePropertySet("Pattern", NewPattern); } else { if ((rbTypeHLOC->Checked == true) || (rbTypeCandle->Checked == True)) { Variant vLStyle = vLStyles.OlePropertyGet("Item", Series); Variant vSymbol = vLStyle.OlePropertyGet("Symbol"); vSymbol.OlePropertySet("Size", NewWidth); } else { Variant vLStyle = vLStyles.OlePropertyGet("Item", Series); Variant vSymbol = vLStyle.OlePropertyGet("Symbol"); vSymbol.OlePropertySet("Shape", NewSymbol); } } //Resume regular updates to the Chart Chart2D1->IsBatched = false; } } } //If the Right Mouse Button was pressed then clear all the Data Styles for // the selected series if (Button == mbRight) { if ((Region == oc2dRegionInLegend) && (Series > 0) && (Distance <= 5)) { Chart2D1->IsBatched = true; //If the Bubble Chart Type is selected, use the the logical Series if (rbTypeBubble->Checked == true) Series = ((Series - 1) * 2) + 1; //If you wish to keep all of the data styles for your points around, you // can use the following method to reset the points individually for (iLoop = 1; iLoop <= 5; ++iLoop) { if ((rbTypeBar->Checked == True) || (rbTypePie->Checked == True) || (rbTypeStackedBar->Checked == True)) { Variant vStyle = vPStyles.OleFunction("Add", Series, iLoop); Variant vFill = vStyle.OlePropertyGet("Fill"); vFill.OlePropertySet("IsDefault", true); } else { Variant vStyle = vPStyles.OleFunction("Add", Series, iLoop); Variant vSymbol = vStyle.OlePropertyGet("Symbol"); vSymbol.OlePropertySet("IsDefault", true); } } //If you just want to remove all the data styles for a complete series // then you can use the following method //PointStyles.RemoveSeries(Series); //Reset the Legend Data Styles for the selected series Variant vLStyle = vLStyles.OlePropertyGet("Item", Series); Variant vSymbol = vLStyle.OlePropertyGet("Symbol"); vSymbol.OlePropertySet("IsDefault", true); Variant vFill = vLStyle.OlePropertyGet("Fill"); vFill.OlePropertySet("IsDefault", true); Chart2D1->IsBatched = false; } } } //--------------------------------------------------------------------------- void __fastcall TfrmDataStyles::Chart2D1MouseMove(TObject *Sender, TShiftState Shift, int X, int Y) //Update the Footer with the current location of the mouse. { long Series, Point, Distance; RegionConstants Region; Variant vCG = Chart2D1->ChartGroups; Variant vCG1 = vCG.OlePropertyGet("Item", 1); //If no buttons are being pressed, then check and see if the mouse is over a data point or // a series in the legend, and update the footer if that is the case Region = (RegionConstants)(short)vCG1.OleFunction("CoordToDataIndex", (long)X, (long)Y, oc2dFocusXY, &Series, &Point, &Distance); if ((Series > 0) && (Distance <= 5)) { if (Region == oc2dRegionInChartArea) { //If the Bubble Chart Type is selected, use the the logical Series if (rbTypeBubble->Checked == true) Series = ((Series - 1) * 2) + 2; Variant vFooter = Chart2D1->Footer; Variant vText = vFooter.OlePropertyGet("Text"); vText.OlePropertySet("Text", "Index (" + Trim(IntToStr(Series)) + ", " + IntToStr(Point) + ")"); } if (Region == oc2dRegionInLegend) { Variant vFooter = Chart2D1->Footer; Variant vText = vFooter.OlePropertyGet("Text"); vText.OlePropertySet("Text", "Series = " + IntToStr(Series)); } } else { Variant vFooter = Chart2D1->Footer; Variant vText = vFooter.OlePropertyGet("Text"); vText.OlePropertySet("Text", "Nowhere"); } } //--------------------------------------------------------------------------- void __fastcall TfrmDataStyles::FormCreate(TObject *Sender) //This is where it all begins! { int iLoop; Variant vCG = Chart2D1->ChartGroups; Variant vCG1 = vCG.OlePropertyGet("Item", 1); //Don't allow the user to make changes to the Chart as we are using the // Right-Click of the mouse to do another function Chart2D1->AllowUserChanges = false; //Start with the form in the top-left corner Top = 5; Left = 5; SetupTheChart(); for (iLoop = 1; iLoop <= 5; ++iLoop) { Variant vLStyles = vCG1.OlePropertyGet("LegendStyles"); vLStyles.OleFunction("Add"); } } //--------------------------------------------------------------------------- void __fastcall TfrmDataStyles::FormResize(TObject *Sender) //Resize the Chart to the size of the form. { Chart2D1->Width = ClientWidth; Chart2D1->Height = ClientHeight - Chart2D1->Top; } //--------------------------------------------------------------------------- void __fastcall TfrmDataStyles::rbTypePlotClick(TObject *Sender) { int iLoop; Variant vCG = Chart2D1->ChartGroups; Variant vCG1 = vCG.OlePropertyGet("Item", 1); Variant vPStyles = vCG1.OlePropertyGet("PointStyles"); Variant vLStyles = vCG1.OlePropertyGet("LegendStyles"); Variant vStyle, vSymbol; Variant vLStyle; Chart2D1->IsBatched = true; vCG1.OlePropertySet("ChartType", oc2dTypePlot); for (iLoop = 1; iLoop <= 5; ++iLoop) { vStyle = vPStyles.OleFunction("Add", 1, iLoop); vSymbol = vStyle.OlePropertyGet("Symbol"); vSymbol.OlePropertySet("Size", 8); vLStyle = vLStyles.OlePropertyGet("Item", 1); vSymbol = vLStyle.OlePropertyGet("Symbol"); vSymbol.OlePropertySet("Size", 7); } ResetAxes(); Variant vCArea = Chart2D1->ChartArea_; vCArea.OlePropertySet("AngleUnit", oc2dAngleUnitDegrees); Chart2D1->IsBatched = false; } //--------------------------------------------------------------------------- void __fastcall TfrmDataStyles::rbTypeBarClick(TObject *Sender) { Chart2D1->IsBatched = true; Variant vCG = Chart2D1->ChartGroups; Variant vCG1 = vCG.OlePropertyGet("Item", 1); vCG1.OlePropertySet("ChartType", oc2dTypeBar); ResetAxes(); Variant vCArea = Chart2D1->ChartArea_; vCArea.OlePropertySet("AngleUnit", oc2dAngleUnitDegrees); Chart2D1->IsBatched = false; } //--------------------------------------------------------------------------- void __fastcall TfrmDataStyles::rbTypePieClick(TObject *Sender) { Chart2D1->IsBatched = true; Variant vCG = Chart2D1->ChartGroups; Variant vCG1 = vCG.OlePropertyGet("Item", 1); vCG1.OlePropertySet("ChartType", oc2dTypePie); Variant vCArea = Chart2D1->ChartArea_; vCArea.OlePropertySet("AngleUnit", oc2dAngleUnitDegrees); Chart2D1->IsBatched = false; } //--------------------------------------------------------------------------- void __fastcall TfrmDataStyles::rbTypeStackedBarClick(TObject *Sender) { Chart2D1->IsBatched = true; Variant vCG = Chart2D1->ChartGroups; Variant vCG1 = vCG.OlePropertyGet("Item", 1); vCG1.OlePropertySet("ChartType", oc2dTypeStackingBar); ResetAxes(); Variant vCArea = Chart2D1->ChartArea_; vCArea.OlePropertySet("AngleUnit", oc2dAngleUnitDegrees); Chart2D1->IsBatched = false; } //--------------------------------------------------------------------------- void __fastcall TfrmDataStyles::rbTypeHLOCClick(TObject *Sender) { int iLoop; Variant vCG = Chart2D1->ChartGroups; Variant vCG1 = vCG.OlePropertyGet("Item", 1); Variant vPStyles = vCG1.OlePropertyGet("PointStyles"); Variant vLStyles = vCG1.OlePropertyGet("LegendStyles"); Variant vStyle, vSymbol; Variant vLStyle; Chart2D1->IsBatched = true; vCG1.OlePropertySet("ChartType", oc2dTypeHiLoOpenClose); for (iLoop = 1; iLoop <= 5; ++iLoop) { vStyle = vPStyles.OleFunction("Add", 1, iLoop); vSymbol = vStyle.OlePropertyGet("Symbol"); vSymbol.OlePropertySet("Size", 8); vLStyle = vLStyles.OlePropertyGet("Item", 1); vSymbol = vLStyle.OlePropertyGet("Symbol"); vSymbol.OlePropertySet("Size", 7); } ResetAxes(); Variant vCArea = Chart2D1->ChartArea_; vCArea.OlePropertySet("AngleUnit", oc2dAngleUnitDegrees); Chart2D1->IsBatched = false; } //--------------------------------------------------------------------------- void __fastcall TfrmDataStyles::rbTypeCandleClick(TObject *Sender) { int iLoop; Variant vCG = Chart2D1->ChartGroups; Variant vCG1 = vCG.OlePropertyGet("Item", 1); Variant vPStyles = vCG1.OlePropertyGet("PointStyles"); Variant vLStyles = vCG1.OlePropertyGet("LegendStyles"); Variant vStyle, vSymbol; Variant vLStyle; Chart2D1->IsBatched = true; vCG1.OlePropertySet("ChartType", oc2dTypeCandle); for (iLoop = 1; iLoop <= 5; ++iLoop) { vStyle = vPStyles.OleFunction("Add", 1, iLoop); vSymbol = vStyle.OlePropertyGet("Symbol"); vSymbol.OlePropertySet("Size", 8); vLStyle = vLStyles.OlePropertyGet("Item", 1); vSymbol = vLStyle.OlePropertyGet("Symbol"); vSymbol.OlePropertySet("Size", 7); } ResetAxes(); Variant vCArea = Chart2D1->ChartArea_; vCArea.OlePropertySet("AngleUnit", oc2dAngleUnitDegrees); Chart2D1->IsBatched = false; } //--------------------------------------------------------------------------- void __fastcall TfrmDataStyles::rbTypePolarClick(TObject *Sender) { int iLoop; Variant vCG = Chart2D1->ChartGroups; Variant vCG1 = vCG.OlePropertyGet("Item", 1); Variant vPStyles = vCG1.OlePropertyGet("PointStyles"); Variant vLStyles = vCG1.OlePropertyGet("LegendStyles"); Variant vStyle, vSymbol; Variant vLStyle; Chart2D1->IsBatched = true; vCG1.OlePropertySet("ChartType", oc2dTypePolar); for (iLoop = 1; iLoop <= 5; ++iLoop) { vStyle = vPStyles.OleFunction("Add", 1, iLoop); vSymbol = vStyle.OlePropertyGet("Symbol"); vSymbol.OlePropertySet("Size", 8); vLStyle = vLStyles.OlePropertyGet("Item", 1); vSymbol = vLStyle.OlePropertyGet("Symbol"); vSymbol.OlePropertySet("Size", 7); } ResetAxes(); Variant vCArea = Chart2D1->ChartArea_; vCArea.OlePropertySet("AngleUnit", oc2dAngleUnitRadians); Chart2D1->IsBatched = false; } //--------------------------------------------------------------------------- void __fastcall TfrmDataStyles::rbTypeRadarClick(TObject *Sender) { int iLoop; Variant vCG = Chart2D1->ChartGroups; Variant vCG1 = vCG.OlePropertyGet("Item", 1); Variant vPStyles = vCG1.OlePropertyGet("PointStyles"); Variant vLStyles = vCG1.OlePropertyGet("LegendStyles"); Variant vStyle, vSymbol; Variant vLStyle; Chart2D1->IsBatched = true; vCG1.OlePropertySet("ChartType", oc2dTypeRadar); for (iLoop = 1; iLoop <= 5; ++iLoop) { vStyle = vPStyles.OleFunction("Add", 1, iLoop); vSymbol = vStyle.OlePropertyGet("Symbol"); vSymbol.OlePropertySet("Size", 8); vLStyle = vLStyles.OlePropertyGet("Item", 1); vSymbol = vLStyle.OlePropertyGet("Symbol"); vSymbol.OlePropertySet("Size", 7); } ResetAxes(); Variant vCArea = Chart2D1->ChartArea_; vCArea.OlePropertySet("AngleUnit", oc2dAngleUnitDegrees); Chart2D1->IsBatched = false; } //--------------------------------------------------------------------------- void __fastcall TfrmDataStyles::rbTypeBubbleClick(TObject *Sender) { float XAxisMin, XAxisMax; long YAxisMin, YAxisMax; Variant vCG = Chart2D1->ChartGroups; Variant vCG1 = vCG.OlePropertyGet("Item", 1); Chart2D1->IsBatched = true; vCG1.OlePropertySet("ChartType", oc2dTypeBubble); //Bump out the X & Y Axis Scales so the Chart looks better Variant vCA = Chart2D1->ChartArea_; Variant vAxes = vCA.OlePropertyGet("Axes"); Variant vXAxis = vAxes.OlePropertyGet("Item", "X"); Variant vYAxis = vAxes.OlePropertyGet("Item", "Y"); Variant vMin = vXAxis.OlePropertyGet("Min"); Variant vMax = vXAxis.OlePropertyGet("Max"); XAxisMin = vMin.OlePropertyGet("Value"); XAxisMax = vMax.OlePropertyGet("Value"); XAxisMin = XAxisMin - 0.5; XAxisMax = XAxisMax + 0.5; vMin.OlePropertySet("Value", XAxisMin); vMax.OlePropertySet("Value", XAxisMax); vMin = vYAxis.OlePropertyGet("Min"); vMax = vYAxis.OlePropertyGet("Max"); YAxisMin = vMin.OlePropertyGet("Value"); YAxisMax = vMax.OlePropertyGet("Value"); YAxisMin = YAxisMin - 5; YAxisMax = YAxisMax + 5; vMin.OlePropertySet("Value", YAxisMin); vMax.OlePropertySet("Value", YAxisMax); Variant vCArea = Chart2D1->ChartArea_; vCArea.OlePropertySet("AngleUnit", oc2dAngleUnitDegrees); Chart2D1->IsBatched = false; } //--------------------------------------------------------------------------- void TfrmDataStyles::SetupTheChart() //Setup how the Chart looks. { Variant vCG = Chart2D1->ChartGroups; Variant vCG1 = vCG.OlePropertyGet("Item", 1); Variant vCA = Chart2D1->ChartArea_; Variant vAxes = vCA.OlePropertyGet("Axes"); Variant vXAxis = vAxes.OlePropertyGet("Item", "X"); Variant vYAxis = vAxes.OlePropertyGet("Item", "Y"); //Batch all the updates to the Chart so all the changes occur at once Chart2D1->IsBatched = true; //Change some colors in the Chart Variant vInterior = Chart2D1->Interior_; vInterior.OlePropertySet("BackgroundColor", (int)ocColorLightSalmon); Variant vPlotArea = vCA.OlePropertyGet("PlotArea"); vInterior = vPlotArea.OlePropertyGet("Interior"); vInterior.OlePropertySet("BackgroundColor", (int)ocColorLightYellow); //Add some SeriesLabels so we get a Legend Variant vSLabels = vCG1.OlePropertyGet("SeriesLabels"); vSLabels.OleFunction("Add", "1"); vSLabels.OleFunction("Add", "2"); vSLabels.OleFunction("Add", "3"); vSLabels.OleFunction("Add", "4"); //Setup the Legend Variant vLegend = Chart2D1->Legend_; Variant vText = vLegend.OlePropertyGet("Text"); vText.OlePropertySet("Text", "Series"); Variant vFont = vLegend.OlePropertyGet("Font"); vFont.OlePropertySet("Name", "Arial"); vFont.OlePropertySet("Size", 10); vFont.OlePropertySet("Bold", true); Variant vBorder = vLegend.OlePropertyGet("Border"); vBorder.OlePropertySet("Type", oc2dBorder3DIn); vBorder.OlePropertySet("Width", 3); vInterior = vLegend.OlePropertyGet("Interior"); vInterior.OlePropertySet("BackgroundColor", (int)ocColorCornsilk); //Setup the Header String HeaderText; Variant vHeader = Chart2D1->Header; vText = vHeader.OlePropertyGet("Text"); HeaderText = "Click on a point to change its symbol or width.\nClick on the legend to change the symbols for its related series.\nRight-Click a series in the legend to remove all added styles for that series."; vText.OlePropertySet("Text", HeaderText); vBorder = vHeader.OlePropertyGet("Border"); vBorder.OlePropertySet("Type", oc2dBorderShadow); vBorder.OlePropertySet("Width", 4); vFont = vHeader.OlePropertyGet("Font"); vFont.OlePropertySet("Name", "Arial"); vFont.OlePropertySet("Size", 10); vFont.OlePropertySet("Bold", true); vInterior = vHeader.OlePropertyGet("Interior"); vInterior.OlePropertySet("BackgroundColor", (int)ocColorGainsboro); //Setup the footer Variant vFooter = Chart2D1->Footer; vText = vFooter.OlePropertyGet("Text"); vText.OlePropertySet("Text", "Nowhere"); vBorder = vFooter.OlePropertyGet("Border"); vBorder.OlePropertySet("Type", oc2dBorder3DIn); vBorder.OlePropertySet("Width", 3); vFont = vFooter.OlePropertyGet("Font"); vFont.OlePropertySet("Name", "Arial"); vFont.OlePropertySet("Size", 10); vFont.OlePropertySet("Bold", true); vInterior = vFooter.OlePropertyGet("Interior"); vInterior.OlePropertySet("BackgroundColor", (int)ocColorGainsboro); //Make some changes to the X-Axis vFont = vXAxis.OlePropertyGet("Font"); vFont.OlePropertySet("Name", "Arial"); vFont.OlePropertySet("Size", 9); vFont.OlePropertySet("Bold", true); Variant vAStyle = vXAxis.OlePropertyGet("AxisStyle"); Variant vLStyle = vAStyle.OlePropertyGet("LineStyle"); vLStyle.OlePropertySet("Width", 2); vAStyle.OlePropertySet("TickLength", 4); //Make some changes to the Y-Axis vFont = vYAxis.OlePropertyGet("Font"); vFont.OlePropertySet("Name", "Arial"); vFont.OlePropertySet("Size", 10); vFont.OlePropertySet("Bold", true); vAStyle = vYAxis.OlePropertyGet("AxisStyle"); vLStyle = vAStyle.OlePropertyGet("LineStyle"); vLStyle.OlePropertySet("Width", 2); vAStyle.OlePropertySet("TickLength", 4); //Setup the 3D View parameters Variant vView3D = vCA.OlePropertyGet("View3D"); vView3D.OlePropertySet("Depth", 10); vView3D.OlePropertySet("Elevation", 10); vView3D.OlePropertySet("Rotation", 20); //Increase all the symbol sizes to make them easier to see Variant vStyles = vCG1.OlePropertyGet("Styles"); Variant vStyle = vStyles.OlePropertyGet("Item", 1); Variant vSymbol = vStyle.OlePropertyGet("Symbol"); vSymbol.OlePropertySet("Size", 8); vStyle = vStyles.OlePropertyGet("Item", 2); vSymbol = vStyle.OlePropertyGet("Symbol"); vSymbol.OlePropertySet("Size", 8); vStyle = vStyles.OlePropertyGet("Item", 3); vSymbol = vStyle.OlePropertyGet("Symbol"); vSymbol.OlePropertySet("Size", 8); vStyle = vStyles.OlePropertyGet("Item", 4); vSymbol = vStyle.OlePropertyGet("Symbol"); vSymbol.OlePropertySet("Size", 8); //Resume regular updates to the Chart Chart2D1->IsBatched = false; } void TfrmDataStyles::ResetAxes() //Reset the Axes Scales back to where they were when we started. { Variant vCA = Chart2D1->ChartArea_; Variant vAxes = vCA.OlePropertyGet("Axes"); Variant vXAxis = vAxes.OlePropertyGet("Item", "X"); Variant vYAxis = vAxes.OlePropertyGet("Item", "Y"); Variant vMin = vXAxis.OlePropertyGet("Min"); Variant vMax = vXAxis.OlePropertyGet("Max"); vMin.OlePropertySet("IsDefault", true); vMax.OlePropertySet("IsDefault", true); vMin = vYAxis.OlePropertyGet("Min"); vMax = vYAxis.OlePropertyGet("Max"); vMin.OlePropertySet("IsDefault", true); vMax.OlePropertySet("IsDefault", true); } //--------------------------------------------------------------------------- // Show the 'About This Demo' Help Page //--------------------------------------------------------------------------- void __fastcall TfrmDataStyles::mnuAboutThisDemoClick(TObject *Sender) { Application->HelpContext(92); } //--------------------------------------------------------------------------- // Show the 'About Olectra Chart' Help Page //--------------------------------------------------------------------------- void __fastcall TfrmDataStyles::mnuAboutOlectraChartClick(TObject *Sender) { Application->HelpContext(19); } //---------------------------------------------------------------------------