Steema Issues Database

Note: 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.



Bug 915 - when there is a 'gap' in TBarSeries.XValues, the bar width is calculated wrongly.
Summary: when there is a 'gap' in TBarSeries.XValues, the bar width is calculated wron...
Status: CONFIRMED
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Series (show other bugs)
Version: 140512
Hardware: PC Windows
: Normal major
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-12 03:19 EDT by h.hasenack
Modified: 2015-05-21 05:39 EDT (History)
1 user (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments
screenshot (55.97 KB, image/gif)
2014-09-12 03:19 EDT, h.hasenack
Details
small demo project (60.44 KB, application/octet-stream)
2014-09-12 03:21 EDT, h.hasenack
Details
Fixes the bar width for irregular data (3.97 KB, text/plain)
2015-05-21 05:39 EDT, h.hasenack
Details

Note You need to log in before you can comment on or make changes to this bug.
Description h.hasenack 2014-09-12 03:19:07 EDT
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.
Comment 1 h.hasenack 2014-09-12 03:21:04 EDT
Created attachment 293 [details]
small demo project
Comment 2 narcís calvet 2014-09-12 07:01:11 EDT
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;
Comment 3 h.hasenack 2014-09-12 08:17:46 EDT
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)
Comment 4 narcís calvet 2014-09-12 08:49:19 EDT
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
Comment 5 h.hasenack 2015-05-21 05:32:42 EDT
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
Comment 6 h.hasenack 2015-05-21 05:39:56 EDT
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.