Page 1 of 1
Histogram plotting
Posted: Thu Jun 07, 2018 12:31 pm
by 9526439
Hi Steema Support,
I have a problem in plotting data in histogram plot.
Currently i have plotted it with dummy data as shown in image.
- histogram
- histogram.jpg (321.45 KiB) Viewed 18847 times
But when i look data in chart and try to understand its plotting according to X and Y scale then plotting looks different with respect to data.
Means i am unable to understand how plotting is done on the data points those are not present in X,Y data list.
Please help me to understand the logic used behind the plotting of histogram.
Regards,
PlanoResearch
Re: Histogram plotting
Posted: Thu Jun 07, 2018 1:36 pm
by Christopher
Hello,
The Histogram series is optimized to draw series with equi-distant X values. Where data has disparate X values it is better to use an Area series with Stairs, e.g.
Code: Select all
private void InitializeChart()
{
double[] xvalues = new double[] { 827, 837, 897, 929, 968, 1009, 1014, 1017, 1026, 1027, 1044, 1066, 1088, 1110, 1113, 1115, 1148, 1196, 1207, 1213, 1297, 1300, 1334, 1343, 1365 };
double[] yvalues = new double[] { 2, 1, 0, 3, 14, 5, 4, 17, 18, 20, 13, 15, 16, 21, 19, 6, 12, 11, 7, 22, 8, 10, 23, 34, 9 };
if(xvalues.Length == yvalues.Length)
{
Area series = new Area(tChart1.Chart);
series.Stairs = true;
series.Add(xvalues, yvalues);
}
}
- TeeChartPro.vshost_2018-06-07_15-34-20.png (25.35 KiB) Viewed 18844 times
Re: Histogram plotting
Posted: Fri Jun 08, 2018 5:41 am
by 9526439
Hi Christopher,
You are right, but my need is that i have to filter data(means remove unwanted data) using histogram.
I am also little bit confused how i achieve this.
If you have any suggestion on this we will appreciate.
Regards,
PlanoResearch
Re: Histogram plotting
Posted: Fri Jun 08, 2018 7:15 am
by Christopher
amol wrote:
You are right, but my need is that i have to filter data(means remove unwanted data) using histogram.
I am also little bit confused how i achieve this.
Why can't you filter data using the Area series?
Re: Histogram plotting
Posted: Fri Jun 08, 2018 10:45 am
by 9526439
Hi Christopher,
Actually my need is to plot data using Histogram.
I have also gone through with excel charts here i have plotted my data. i m attaching images of same. On excel my data plotted correctly. i want to plot similar in teechart.
- first image
- img1.jpg (103.1 KiB) Viewed 18833 times
As shown in first image data is plotted on histogram chart with 3 bins.
- second image
- img2.jpg (104.41 KiB) Viewed 18832 times
As shown in second image i have changed number of bins to 5. And after changing number of pillar/bars increased.
- third image
- image3.jpg (332.93 KiB) Viewed 18831 times
But in third image i have plotted same data with teechart but it plots data differently. why?
One more thing in teechart histogram, there is no property to set bins number. And my need is to change bins dynamically over the plotted data.
Kindly help i want to plot similar chart using teechart as plotted in excel.
Regards,
PlanoResearch
Re: Histogram plotting
Posted: Fri Jun 08, 2018 11:20 am
by Christopher
amol wrote:
But in third image i have plotted same data with teechart but it plots data differently. why?
One more thing in teechart histogram, there is no property to set bins number. And my need is to change bins dynamically over the plotted data.
Kindly help i want to plot similar chart using teechart as plotted in excel.
Please bear in mind that, as a business, we cannot dedicate very much time to helping you write your applications without receiving payment for it. So any help you can give us whereby we can spend less time helping your write your applications is greatly appreciated. TeeChart was not specifically designed to replicate Excel functionality nor has it ever been sold as doing so, and as such we do not feel obliged to spend time, without payment, producing code which replicates Excel.
In this particular case, then, could you please spend some time making an attempt to produce the functionality you need so that we can run this code here to save us the time of writing it ourselves. As a guide you may like to consider Stackoverflow's directives for a Minimal, Complete, and Verifiable (MCVE) example you can read about
here. Once in receipt of the MCVE you have written for us we can then help you in achieving your final goals.
Thank you.
Re: Histogram plotting
Posted: Fri Jun 08, 2018 12:19 pm
by 9526439
Hi Steema Support,
As you suggested i am attaching demo for your help. Please find it from attachment.
We are using teechart version 2012.
regards,
Planoresearch
Re: Histogram plotting
Posted: Mon Jun 11, 2018 7:33 am
by Christopher
amol wrote:
As you suggested i am attaching demo for your help. Please find it from attachment.
We are using teechart version 2012.
That you are using version 2012 means that it is six years since you have paid Steema for an upgrade. If all our clients did not pay for upgrades Steema would soon be out of business!
I have run your test project, but as far as I can see it does not reproduce a problem with TChart here. Neither does the project give any indication of your requirements, nor has any effort been made to produce a project which clearly shows where your problem is.