![]() | Steema Issues DatabaseNote: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;otherwise you can use StackOverflow. Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy. |
| Summary: | when there is a 'gap' in TBarSeries.XValues, the bar width is calculated wrongly. | ||
|---|---|---|---|
| Product: | VCL TeeChart | Reporter: | h.hasenack <hans> |
| Component: | Series | Assignee: | Steema Issue Manager <issuemanager> |
| Status: | CONFIRMED --- | ||
| Severity: | major | CC: | narcis |
| Priority: | Normal | ||
| Version: | 140512 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows | ||
| Chart Series: | --- | Delphi / C++ Builder RAD IDE Version: | |
| Attachments: |
screenshot
small demo project Fixes the bar width for irregular data |
||
Created attachment 293 [details]
small demo project
This has a very easy workaround, which is adding null bars: procedure TForm5.btBarWidthTroubleClick(Sender: TObject); begin Series1.Clear; Series2.Clear; Series1.AddXY(10,10); Series1.AddXY(20,10); Series1.AddXY(30,10); //Workaround adding null bars Series1.AddNullXY(40, 10); Series1.AddNullXY(50, 10); Series1.AddNullXY(60, 10); Series1.AddNullXY(70, 10); Series1.AddNullXY(80, 10); Series1.AddNullXY(90, 10); // adding the extra bar with a higher X value causes the bar width to 'explode'. // The bar width should be based upon the smallest delta between X-values rather than // the # of data points in a bar series Series1.AddXY(100,10); end; I know about the workaround. The thing is that my end users want to load data from a query in XY pairs. adding extra null records to the query outpout is quite complicated hence I would rather like to it fixed in TeeChart. (same goes for bug 914 to which you already replied) Thanks for the info. I have added reopened and added a reference to your comment at http://bugs.teechart.net/show_bug.cgi?id=914 I came up with a working solution for this. Take a look at the attached series.pas and look for the HH_PATCH_BARWIDTH defines Created attachment 449 [details]
Fixes the bar width for irregular data
Only the changed routines are incorporated in the .pas file. You have to paste it ninto your complete series.pas file of TChart.
|
Created attachment 292 [details] screenshot Check the attached applm using the btBarWidthTrouble button. Barwidth bas based on the # of datapoints, but should actually bge based on the minimum of the X value intervals.