Update of /cvsroot/jvcl/dev/JVCL3/examples/JvChartDemo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18126/examples/JvChartDemo Modified Files: .cvsignore JvChartDemo.dof JvChartDemo.res JvChartDemoFm.dfm JvChartDemoFm.pas Log Message: JVCHART: BUGFIX Plotting of Negative values was broken, and any Y Minimum Scale value other than 0 was broken. Fixed. JvChart's Demos (delphi and bcb versions) in examples directory has also been updated to show plotting of negative values and a range from 0..20 or -20..+20, so that we can demonstration the feature. REMOVED AutoFormatGraph. Any code that invokes AutoFormatGraph should only need to call PlotGraph now. Index: .cvsignore =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/examples/JvChartDemo/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .cvsignore 8 Mar 2004 22:00:10 -0000 1.1 --- .cvsignore 24 Jun 2004 13:46:58 -0000 1.2 *************** *** 1 **** ! JvChartDemoFm.ddp \ No newline at end of file --- 1,2 ---- ! JvChartDemoFm.ddp ! JvChartDemo.mps \ No newline at end of file Index: JvChartDemo.res =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/examples/JvChartDemo/JvChartDemo.res,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsBLkMFj and /tmp/cvszGgyjb differ Index: JvChartDemoFm.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/examples/JvChartDemo/JvChartDemoFm.pas,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** JvChartDemoFm.pas 26 May 2004 08:38:41 -0000 1.18 --- JvChartDemoFm.pas 24 Jun 2004 13:46:58 -0000 1.19 *************** *** 78,81 **** --- 78,82 ---- PrintDialog1: TPrintDialog; MenuSecondaryAxisMode: TMenuItem; + MenuNegValueTest: TMenuItem; procedure FormResize(Sender: TObject); procedure ButtonLineClick(Sender: TObject); *************** *** 111,114 **** --- 112,116 ---- procedure ListBox1DblClick(Sender: TObject); procedure ListBox1Click(Sender: TObject); + procedure MenuNegValueTestClick(Sender: TObject); private *************** *** 119,122 **** --- 121,125 ---- FStatHgt,FStatHg0:TStatArray; Fdt,Fds:Double; + FNegValueFlag :Boolean; protected *************** *** 154,157 **** --- 157,165 ---- FHgt := Abs(Random(80)+(Random(((FGenerationIndex div foo) mod foo1) * 250) * 5 + 9500)); FHg0 := Abs(Random(280)+Random(((FGenerationIndex div foo) mod foo2) * 650)*5 + 1003); + if FNegValueFlag then begin + if (Random(80) > 75) or (FGenerationIndex=2) then begin + FHg0 := -1 * FHg0; // Generate a negative value! (just to show what it looks like) + end; + end; Inc(FGenerationIndex); end; *************** *** 189,194 **** Chart.Data.Value[0, I] := FStatHgt.Average /1000; ! // Test blanks on big chart, show missing data: ! Chart.Data.Value[1, I] := FStatHg0.Average/1000; Fhg2p := ( FStatHgt.Average - FStatHg0.Average)/1000; --- 197,206 ---- Chart.Data.Value[0, I] := FStatHgt.Average /1000; ! if FHg0<0 then begin ! Chart.Data.Value[1, I] := FHg0/1000; // Don't show average with negative samples or my negative demo ability goes away (averaged out!) ! end else begin ! // Test blanks on big chart, show missing data: ! Chart.Data.Value[1, I] := FStatHg0.Average/1000; ! end; Fhg2p := ( FStatHgt.Average - FStatHg0.Average)/1000; *************** *** 311,314 **** --- 323,331 ---- YAxisHeader := 'Readings (ng/m3)'; + if FNegValueFlag then begin + PrimaryYAxis.YMin := -20; + PrimaryYAxis.YMax := 20; + end else + PrimaryYAxis.YMin := 0; // Try out the pen styles: if ChartKind = ckChartStackedBar then *************** *** 319,322 **** --- 336,341 ---- PenStyle[2] := psDot; + + if MenuSecondaryAxisMode.Checked then begin PenCount := 4; // Add a pen for right side demo. *************** *** 325,330 **** // response percentage, is plotted from 0% to 140% // of expected value. ! SecondaryYAxis.YMin := 0; SecondaryYAxis.YLegendDecimalPlaces := 2; PenSecondaryAxisFlag[3] := True; // Move pen index 3 (Fourth pen) to secondary axis. PenMarkerKind[3] := pmkDiamond; --- 344,351 ---- // response percentage, is plotted from 0% to 140% // of expected value. ! SecondaryYAxis.YLegendDecimalPlaces := 2; + + PenSecondaryAxisFlag[3] := True; // Move pen index 3 (Fourth pen) to secondary axis. PenMarkerKind[3] := pmkDiamond; *************** *** 358,363 **** //ChartKind := ckChartLine; end; ! Chart.AutoFormatGraph; ! //Chart.PlotGraph; //Chart.ResizeChartCanvas; end; --- 379,385 ---- //ChartKind := ckChartLine; end; ! // Chart.AutoFormatGraph; ! Chart.PlotGraph; ! //Chart.ResizeChartCanvas; end; *************** *** 458,466 **** procedure TJvChartDemoForm.Button4Click(Sender: TObject); begin ! // Chart.SetYMaxMin(10000,0); ! // Chart.Options.YMax := 10000; ! // Chart.Options.YMin := 10000; ! Chart.AutoFormatGraph; ! // Chart.PlotGraph; end; --- 480,486 ---- procedure TJvChartDemoForm.Button4Click(Sender: TObject); begin ! ! // Chart.AutoFormatGraph; WAP Removed. BAD CODE. ! Chart.PlotGraph; end; *************** *** 610,613 **** --- 630,639 ---- end; + procedure TJvChartDemoForm.MenuNegValueTestClick(Sender: TObject); + begin + FNegValueFlag := MenuNegValueTest.Checked; + NewValues; + end; + end. Index: JvChartDemoFm.dfm =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/examples/JvChartDemo/JvChartDemoFm.dfm,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** JvChartDemoFm.dfm 26 May 2004 08:38:41 -0000 1.13 --- JvChartDemoFm.dfm 24 Jun 2004 13:46:58 -0000 1.14 *************** *** 23,27 **** Top = 35 Width = 597 ! Height = 408 Align = alClient Options.XAxisValuesPerDivision = 10 --- 23,27 ---- Top = 35 Width = 597 ! Height = 400 Align = alClient Options.XAxisValuesPerDivision = 10 *************** *** 33,36 **** --- 33,37 ---- Options.YStartOffset = 42 Options.PrimaryYAxis.YMax = 20.000000000000000000 + Options.PrimaryYAxis.YDivisions = 20 Options.PrimaryYAxis.YLegendDecimalPlaces = 1 Options.SecondaryYAxis.YMax = 140.000000000000000000 *************** *** 65,69 **** Left = 121 Top = 35 ! Height = 408 end object PanelTop: TPanel --- 66,70 ---- Left = 121 Top = 35 ! Height = 400 end object PanelTop: TPanel *************** *** 332,336 **** Top = 35 Width = 121 ! Height = 408 Align = alLeft Color = clBtnFace --- 333,337 ---- Top = 35 Width = 121 ! Height = 400 Align = alLeft Color = clBtnFace *************** *** 413,416 **** --- 414,422 ---- OnClick = DateTimeAxisModeClick end + object MenuNegValueTest: TMenuItem + AutoCheck = True + Caption = 'Use Positive and Negative Demo Values (-20..+20)' + OnClick = MenuNegValueTestClick + end object MenuSecondaryAxisMode: TMenuItem Caption = '&Plot Markers+Values using Alternate Scale (0-120%)' Index: JvChartDemo.dof =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/examples/JvChartDemo/JvChartDemo.dof,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** JvChartDemo.dof 1 Apr 2004 17:38:28 -0000 1.8 --- JvChartDemo.dof 24 Jun 2004 13:46:58 -0000 1.9 *************** *** 1,8 **** --- 1,139 ---- + [FileVersion] + Version=7.0 [Compiler] + A=8 + B=0 + C=1 + D=1 + E=0 + F=0 + G=1 + H=1 + I=1 + J=0 + K=0 + L=1 + M=0 + N=1 + O=0 + P=1 + Q=0 + R=0 + S=0 + T=0 + U=0 + V=1 + W=0 + X=1 + Y=1 + Z=1 + ShowHints=1 + ShowWarnings=1 + UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + NamespacePrefix= + SymbolDeprecated=0 + SymbolLibrary=1 + SymbolPlatform=1 + UnitLibrary=1 + UnitPlatform=1 + UnitDeprecated=1 + HResultCompat=1 + HidingMember=1 + HiddenVirtual=1 + Garbage=1 + BoundsError=1 + ZeroNilCompat=1 + StringConstTruncated=1 + ForLoopVarVarPar=1 + TypedConstVarPar=1 + AsgToTypedConst=1 + CaseLabelRange=1 + ForVariable=1 + ConstructingAbstract=1 + ComparisonFalse=1 + ComparisonTrue=1 + ComparingSignedUnsigned=1 + CombiningSignedUnsigned=1 + UnsupportedConstruct=1 + FileOpen=1 + FileOpenUnitSrc=1 + BadGlobalSymbol=1 + DuplicateConstructorDestructor=1 + InvalidDirective=1 + PackageNoLink=1 + PackageThreadVar=1 + ImplicitImport=1 + HPPEMITIgnored=1 + NoRetVal=1 + UseBeforeDef=1 + ForLoopVarUndef=1 + UnitNameMismatch=1 + NoCFGFileFound=1 + MessageDirective=1 + ImplicitVariants=1 + UnicodeToLocale=1 + LocaleToUnicode=1 + ImagebaseMultiple=1 + SuspiciousTypecast=1 + PrivatePropAccessor=1 UnsafeType=0 UnsafeCode=0 UnsafeCast=0 + [Linker] + MapFile=0 + OutputObjs=0 + ConsoleApp=1 + DebugInfo=0 + RemoteSymbols=0 + MinStackSize=16384 + MaxStackSize=1048576 + ImageBase=4194304 + ExeDescription= [Directories] OutputDir=..\..\bin UnitOutputDir=..\..\dcu + PackageDLLOutputDir= + PackageDCPOutputDir= SearchPath=..\..\run;..\..\common + Packages=vcl;rtl;vclx;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;CPortLib7;FlexD7;GridViewD7;SynEdit_D7;VirtualTreesD7;JvStdCtrlsD7R;JvAppFrmD7R;JvCoreD7R;JvBandsD7R;JvCmpD7R;JvCryptD7R;JvCtrlsD7R;JvCustomD7R;JvDlgsD7R;JvDockingD7R;JvDotNetCtrlsD7R;qrpt;JvGlobusD7R;JvHMID7R;JvInterpreterD7R;JvJansD7R;JvManagedThreadsD7R;JvMMD7R;JvPageCompsD7R;JvPluginD7R;JvPrintPreviewD7R;JvSystemD7R;JvTimeFrameworkD7R;JvUIBD7R;JvValidatorsD7R;JvWizardD7R;JvXPCtrlsD7R;JvNetD7R;B305vr70;JvBDED7R;JvDBD7R;DJcl;JvInspectorD7R;BatonServer_d7;Indy70;BatonClient_d7;Rave50CLX;Rave50VCL;ModbusPkg;ColorPickerButton_pkg + Conditionals= + DebugSourceDirs= + UsePackages=0 + [Parameters] + RunParams= + HostApplication= + Launcher= + UseLauncher=0 + DebugCWD= + [Language] + ActiveLang= + ProjectLang= + RootDir= + [Version Info] + IncludeVerInfo=0 + AutoIncBuild=0 + MajorVer=1 + MinorVer=0 + Release=0 + Build=0 + Debug=0 + PreRelease=0 + Special=0 + Private=0 + DLL=0 + Locale=1033 + CodePage=1252 + [Version Info Keys] + FileVersion=1.0.0.0 + [HistoryLists\hlUnitAliases] + Count=1 + Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + [HistoryLists\hlSearchPath] + Count=1 + Item0=..\..\run;..\..\common + [HistoryLists\hlUnitOutputDirectory] + Count=1 + Item0=..\..\dcu + [HistoryLists\hlOutputDirectorry] + Count=1 + Item0=..\..\bin |