0

I tried to decrease space between space between columns and also wanted to decrease width of columns, but I was only able to adjust width of columns not space between columns.

enter image description here

please help for solution. I really appreciate the effort.

Code snap: `

            for (int i = 0; i < dss.Tables[1].Rows.Count; i++)
            {
                yValues[i] = Convert.ToDouble(dss.Tables[1].Rows[i]["admission"].ToString());

                if (isDateRange == 1)
                {
                    xValues[i] = dss.Tables[1].Rows[i]["mth"].ToString().Substring(0, dss.Tables[1].Rows[i]["mth"].ToString().IndexOf(" "));
                }
                else
                {
                    xValues[i] = dss.Tables[1].Rows[i]["mth"].ToString();
                }

                zValues[i] = Convert.ToDouble(dss.Tables[1].Rows[i]["readmission"].ToString());
            }

            chart1.Series[0].Points.DataBindXY(xValues, yValues);
            chart1.Series[0].ToolTip = "#AXISLABEL: #VALY";
            chart1.Series[0]["PieLabelStyle"] = "Outside";
            chart1.Series[0]["PieDrawingStyle"] = "Concave";
            chart1.Series[1].Points.DataBindXY(xValues, zValues);
            chart1.Series[1].ToolTip = "#AXISLABEL: #VALY";


            var chartArea_chart1 = chart1.ChartAreas[chart1.Series[0].ChartArea];
            // enable autoscroll
            chartArea_chart1.CursorY.AutoScroll = true;

            // let's zoom to [0,blockSize] (e.g. [0,100])
            chartArea_chart1.AxisX.ScaleView.Zoomable = true;
            chartArea_chart1.AxisX.ScaleView.SizeType = DateTimeIntervalType.Number;

            //chartArea_chart1.AxisY.ScaleView.Zoomable = true;
            //chartArea_chart1.AxisY.ScaleView.SizeType = DateTimeIntervalType.Auto;

            //chart1.Series[0].CustomProperties ="PixelPointWidth = 10";
            //chart1.Series[0].CustomProperties = "PointWidth = 0.1";

            int position = 0;
            int size = 30;
            chartArea_chart1.AxisX.ScaleView.Zoom(position, size);

            // disable zoom-reset button (only scrollbar's arrows are available)
            chartArea_chart1.AxisX.ScrollBar.ButtonStyle = ScrollBarButtonStyles.SmallScroll;`
TaW
  • 53,122
  • 8
  • 69
  • 111
Gotu31
  • 1
  • 1
  • Please provide the code you are using to draw the chart. – Dan Wilson Aug 03 '18 at 14:46
  • Hi Dan Wilson, Added code snap in main description. Thanks! – Gotu31 Aug 03 '18 at 15:04
  • Don't post a picture of your code here. It is a bad policy and discourages members to help you. It is better if you write the code or copy and past it here – Lewis86 Aug 03 '18 at 15:11
  • 1
    Hi Lewis86, Thanks for advise. – Gotu31 Aug 03 '18 at 15:28
  • You can't really control the columns beyond their width. See [here](https://stackoverflow.com/questions/40801190/let-column-charts-overlap-in-chart-control/40804678#40804678) for an example of owner-drawing the whole stuff, which is meant more dis dis- than to encourage you.. - In your case you could try to set the x-axis maximum, but it won't work that well.. ((You would increase it to squeeze the columns together..)) - Btw: Your code looks as if it could do with some cleaning up ;-) – TaW Aug 03 '18 at 15:38
  • Hi @TaW, Thanks!. However it won't work for me. You are right we can't control the columns beyond their width. – Gotu31 Aug 03 '18 at 16:01

0 Answers0