Hi,
I need some help to do the following:
Right now, I have a pie chart that shows products being registered on a database table in real time, it is interesting as it evolves rapidly and clearly shows the preference for some products over others. But this chart is cumulative from the start date-time until the current date-time. It does not show what happens on each hour, so for this detail I have another Stack-Bar that groups the products being registered on the same database table in a hour-by-hour basis, however it is not currently differentiating products at the bar level, that is, it only shows one color with the count of the products by each hour.
How could I have a stacked bar that shows the different products by each hour (each one with a different color, basically)? Is it possible to do that at design time or must it be done at runtime creating multiple series? How would a minimal C++ Builder Stacked Bar example look like?
Best regards,
PCSdeZ
Getting stacked bars to work
Re: Getting stacked bars to work
Hello,
Something like this? I did this at design time, adding 4 series, setting their titles, setting them to be Stacked, and setting their labels "hour1", "hour 2",...
If this is not what you are trying to do, don't hesitate to give us more details.
Something like this? I did this at design time, adding 4 series, setting their titles, setting them to be Stacked, and setting their labels "hour1", "hour 2",...
If this is not what you are trying to do, don't hesitate to give us more details.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Getting stacked bars to work
Thanks Yeray,
Yes, exactly this kind of chart.
So, I understand now that each bar segment is associated to a particular series and color as well.
However, in my project I need to use a Dataset whose number of products and quantity varies each hour, so how can I make the association of the Dataset with the series to ensure that the bar and their segments appear or disappear, grow or shrink, on runtime?
To be more precise, I'm currently using only one series made at design time connected to a Dataset (see below) with a Summary, Sum of CantMatched column for Calc and using FH_Creacion for Group by, however it shows only one segment and color.
This is the SQL for the Dataset:
Best regards,
PCSdeZ
Yes, exactly this kind of chart.
So, I understand now that each bar segment is associated to a particular series and color as well.
However, in my project I need to use a Dataset whose number of products and quantity varies each hour, so how can I make the association of the Dataset with the series to ensure that the bar and their segments appear or disappear, grow or shrink, on runtime?
To be more precise, I'm currently using only one series made at design time connected to a Dataset (see below) with a Summary, Sum of CantMatched column for Calc and using FH_Creacion for Group by, however it shows only one segment and color.
This is the SQL for the Dataset:
Code: Select all
select A.FH_Creacion, B.Keyname, Count(B.Keyname) as CantMatched
from Querys A inner join Keys B on A.IdKey = B.Id, TiposKeys C
where B.Id_TipoKey = C.Id and A.Matched = True
and ((0 = :Periodo and A.FH_Creacion between (current_date - 90) and (current_date + 1))
or (1 = :Periodo and A.FH_Creacion between (current_date - 180) and (current_date + 1))
or (2 = :Periodo and A.FH_Creacion between (current_date - 365) and (current_date + 1))
or (3 = :Periodo and A.FH_Creacion between (current_date - 365 * 5) and (current_date + 1)))
and ((0 = :IdTipoKey and C.Id in (1,2,3,4)) or C.Id = :IdTipoKey)
group by A.FH_Creacion, B.Keyname
order by 1, 2
PCSdeZ
Re: Getting stacked bars to work
Hello,
If the dataset is not very big, the easiest would be to completely remove the chart and recreate all the series and points for each series every hour. This way, you'll always have fresh data in your chart.
Regarding the exact code you are using, it's difficult to see what's exactly going on without a simple example.
If you still find problems with it, please try to arrange a simple example project we can run as-is to reproduce the problem here.
If the dataset is not very big, the easiest would be to completely remove the chart and recreate all the series and points for each series every hour. This way, you'll always have fresh data in your chart.
Regarding the exact code you are using, it's difficult to see what's exactly going on without a simple example.
If you still find problems with it, please try to arrange a simple example project we can run as-is to reproduce the problem here.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |