Gant chart dynamic height

Stimulsoft Reports.JS discussion
Post Reply
StimulsoftUser
Posts: 5
Joined: Tue Apr 02, 2024 4:54 pm

Gant chart dynamic height

Post by StimulsoftUser »

We use a Gant chart. A single horizontal rectangle represents 2 time-related information and 1 category information. How to ensure automatic expansion of the chart vertically (with constant rectangle height) depending on the number of such rectangles.
Lech Kulikowski
Posts: 6291
Joined: Tue Mar 20, 2018 5:34 am

Re: Gant chart dynamic height

Post by Lech Kulikowski »

Hello,

Coul dyou explain your task in more details?

Thank you.
StimulsoftUser
Posts: 5
Joined: Tue Apr 02, 2024 4:54 pm

Re: Gant chart dynamic height

Post by StimulsoftUser »

Let's assume that we place a component on the page in the designer - a Gant chart with a height of 1/2 the height of the page. When generating a report, the chart receives data from the back-end (appropriate data source in the dictionary). If we get only 1 value from the backend, we will have 1 horizontal bar on the chart. If we get 5 values ​​from the backend, we will have 5 horizontal bars on the chart, but their height (thickness) will be smaller. In cases 1 and 2, the chart takes up 1/2 of the page. We want the height (thickness) of the horizontal bar to remain the same and the height of the chart to change, i.e. so that the chart can "grow" vertically, just like a table.
Lech Kulikowski
Posts: 6291
Joined: Tue Mar 20, 2018 5:34 am

Re: Gant chart dynamic height

Post by Lech Kulikowski »

Hello,

As a way, you can check count data and set the Height property of the Chart component in events.

Thank you.
Attachments
ChartHeight.mrt
(9.72 KiB) Downloaded 37 times
StimulsoftUser
Posts: 5
Joined: Tue Apr 02, 2024 4:54 pm

Re: Gant chart dynamic height

Post by StimulsoftUser »

Hello. Thank you for your answer. Which viewer event would be most appropriate ? Is any event emitted after pressing the send button in the User Panel ?
StimulsoftUser
Posts: 5
Joined: Tue Apr 02, 2024 4:54 pm

Re: Gant chart dynamic height

Post by StimulsoftUser »

Hello Lech,

Can placing a chart on a component that can expand vertically cause the chart to also grow in height ?
Lech Kulikowski
Posts: 6291
Joined: Tue Mar 20, 2018 5:34 am

Re: Gant chart dynamic height

Post by Lech Kulikowski »

Hello,

> Which viewer event would be most appropriate ? Is any event emitted after pressing the send button in the User Panel ?

For example, onInteraction event:
https://www.stimulsoft.com/en/documenta ... events.htm

> Can placing a chart on a component that can expand vertically cause the chart to also grow in height ?

No. The chart component has static height and width properties.

Thank you.
Post Reply