Page 1 of 1

Bars are displyed saperately w.r.t left and right axes

Posted: Thu Feb 04, 2021 1:53 pm
by 9641422
Hi Steema,

We have used TChart.Net 2012 and created a bar chat. In which we have plotted multiple bar series on left and bottom axis. Now we want to add some bar series on Right and bottom axis.
When we created this chart then the xyz bar snugly with "Jan" label.
If we set the MultiBars Styles as "SideAll" then all bars are displayed separately.
So we want to display the chart as same as attached image.
Bar chart.png
Bar chart.png (35.64 KiB) Viewed 9889 times
For your reference, we have also added a demo.


Thanks
Amol

Re: Bars are displyed saperately w.r.t left and right axes

Posted: Fri Feb 05, 2021 8:49 am
by Christopher
Hello,

yes, this is possible - I've attached a retouched project, which here gives me:
WindowsFormsApplication1_2021-02-05_09-46-34.png
WindowsFormsApplication1_2021-02-05_09-46-34.png (17.07 KiB) Viewed 9833 times

Re: Bars are displyed saperately w.r.t left and right axes

Posted: Sat Feb 06, 2021 11:13 am
by 9641422
Thanks for your valuable reply.
I have run your code and found that that in demo, axis line of left and right axis and legend are not visible.

Thanks
Amol

Re: Bars are displyed saperately w.r.t left and right axes

Posted: Mon Feb 08, 2021 9:39 am
by Christopher
Hello Amol,

Commenting out some existing code and adding in a couple more lines gives me the following:
WindowsFormsApplication1_2021-02-08_10-37-19.png
WindowsFormsApplication1_2021-02-08_10-37-19.png (17.67 KiB) Viewed 9755 times

Code: Select all

            ArrangeBottomAxes(m_bar2);

            //m_bar2.MultiBar = Steema.TeeChart.Styles.MultiBars.SideAll;

            //tChart1.Legend.Visible = true;
            //tChart1.Aspect.View3D = false;


            //tChart1.Legend.CustomPosition = true;
            //tChart1.Legend.LegendStyle = LegendStyles.Series;
            //tChart1.Legend.Shadow.Visible = false;
            //tChart1.Legend.Transparency = 100;
            //tChart1.Legend.Top = 100;
            //tChart1.Legend.Left = 900;

            tChart1.Axes.Bottom.Title.Text = "X-Axes";
            tChart1.Axes.Left.Title.Text = "Y-Axes";
            //tChart1.Axes.Right.Title.Text = m_Points3.Title;// Right-Axes title

            tChart1.Axes.Left.Grid.Visible = true;
            tChart1.Axes.Left.Grid.Color = Color.Red;
            tChart1.Axes.Left.Grid.DrawEvery = 1;
            tChart1.Axes.Right.Grid.Visible = true;
            tChart1.Axes.Right.Grid.Color = Color.Blue;
            tChart1.Axes.Right.Grid.DrawEvery = 1;

Re: Bars are displyed saperately w.r.t left and right axes

Posted: Tue Feb 09, 2021 4:53 pm
by 9641422
Hi Steema,

Thanks for your valuable support.

We have got your code but in chart the vertical Axis line, in which ticks and labels are showing, are missing. Only the grid lines are displayed on chart.
But we want to display the vertical axes lines(i.e. Y-Axis and Alternate Y axis) on chart.

Thanks & regards
Amol