how to programmatically hide intervals?
- dmasterplan
- Posts: 143
- Joined: Thu Mar 17, 2022 4:04 am
- Location: Philippines
how to programmatically hide intervals?
Hello,
How to programmatically hide intervals?
These:
Area> Visible = True
Area > Y Axis > Line Color = Transparent
and how to do it if I want to set other properties?
How to figure it out?
View Code? How? (I'm not sure if I am asking the right question)
Great Thanks
How to programmatically hide intervals?
These:
Area> Visible = True
Area > Y Axis > Line Color = Transparent
and how to do it if I want to set other properties?
How to figure it out?
View Code? How? (I'm not sure if I am asking the right question)
Great Thanks
-
- Posts: 792
- Joined: Tue Sep 07, 2021 10:11 am
Re: how to programmatically hide intervals?
Hello,
Use the following code:
Thank you.
Use the following code:
Code: Select all
StiChart chart = report.GetComponentByName("Chart1") as StiChart;
StiClusteredBarArea area = chart.Area as StiClusteredBarArea;
// disable Y Axis visible
area.YAxis.Visible = false;
// or change labels color
area.YAxis.Labels.Color = Color.Transparent;
- dmasterplan
- Posts: 143
- Joined: Thu Mar 17, 2022 4:04 am
- Location: Philippines
Re: how to programmatically hide intervals?
I put it in Chart's Before Print event but it triggered 5 errors. Please help!
- Attachments
-
- errors.png (159.7 KiB) Viewed 386 times
- dmasterplan
- Posts: 143
- Joined: Thu Mar 17, 2022 4:04 am
- Location: Philippines
Re: how to programmatically hide intervals?
I tried this and it worked. Is this the correct way of doing it?
this.Chart2_Area.BorderColor = System.Drawing.Color.Transparent;
this.Chart2_Area.YAxis.Visible = false;
Thanks
this.Chart2_Area.BorderColor = System.Drawing.Color.Transparent;
this.Chart2_Area.YAxis.Visible = false;
Thanks
Last edited by dmasterplan on Thu Apr 21, 2022 12:59 pm, edited 1 time in total.
-
- Posts: 792
- Joined: Tue Sep 07, 2021 10:11 am
Re: how to programmatically hide intervals?
Hello,
Yes, this is the right way, if you want to hide the Y-axis, you can use your code in the Before Print event.
Thank you.
Yes, this is the right way, if you want to hide the Y-axis, you can use your code in the Before Print event.
Thank you.
Re: how to programmatically hide intervals?
Please note the following:
When a component will be rendered/prepared, a copy of the component may be created before. To ensure you are working on the right instance of the component, in the events you should use the object of the input parametert "sender" (which is of type object), which contains the current chart element in your sample. So better use something like "StiChart chart = sender as StiChart;" and make youre changes on this instance.
When a component will be rendered/prepared, a copy of the component may be created before. To ensure you are working on the right instance of the component, in the events you should use the object of the input parametert "sender" (which is of type object), which contains the current chart element in your sample. So better use something like "StiChart chart = sender as StiChart;" and make youre changes on this instance.
- dmasterplan
- Posts: 143
- Joined: Thu Mar 17, 2022 4:04 am
- Location: Philippines
Re: how to programmatically hide intervals?
Great thanks! You guys are enormous help!
-
- Posts: 792
- Joined: Tue Sep 07, 2021 10:11 am
Re: how to programmatically hide intervals?
Hello,
You are welcome.
You are welcome.