Note that there are some explanatory texts on larger screens.

plurals
  1. POCharting problems
    primarykey
    data
    text
    <p>I'm having some problems putting a "company goal" on my column chart. I am doing it as a line graph, but the line needs to extend more left, and more right. I've tried setting the x to before where my column chart starts but that doesn't help, it still doesn't start on y axis and and shifts all my info over. this is what I'm getting:</p> <p><img src="https://i.imgur.com/iqz2z.jpg" alt="what I&#39;m getting"></p> <p>and this is sort of the idea I'm going for : </p> <p><img src="https://i.imgur.com/HyG5X.jpg" alt="what I&#39;m going for"></p> <p>i realize that i probably wont be able to get individual goals on there because it's one point, but if someone has an idea...I'm all ears...other than 3d column chart with company and individual goals behind the first 2 series..already though of that, but its not the look I'm going for.</p> <p>Code:</p> <pre><code>int x = 0; Chart1.Series.Add("currmonth"); Chart1.Series["currmonth"].ChartType = SeriesChartType.Column; Chart1.Series["currmonth"].SmartLabelStyle.Enabled = true; Chart1.Series.Add("prevmonth"); Chart1.Series["prevmonth"].ChartType = SeriesChartType.Column; Chart1.Series["prevmonth"].SmartLabelStyle.Enabled = true; Chart1.Series.Add("compgoal"); Chart1.Series["compgoal"].ChartType = SeriesChartType.Line; Chart1.ChartAreas[0].AxisX.Minimum = 0; Chart1.ChartAreas[0].AxisX.Maximum = 5; DataPoint dp3 = new DataPoint(); dp3.SetValueXY(0, 115); dp3.BorderWidth = 3; Chart1.Series["compgoal"].Points.Add(dp3); DataPoint dp4 = new DataPoint(); dp4.SetValueXY(5, 115); dp4.BorderWidth = 3; Chart1.Series["compgoal"].Points.Add(dp4); while (x &lt; 4) { /*DataPoint dp3 = new DataPoint(); dp3.YValues = new double[] { Convert.ToDouble(115) }; dp3.BorderWidth = 3; Chart1.Series["compgoal"].Points.Add(dp3);*/ //--------------------------------------------------------------------------- DataPoint dp = new DataPoint(); dp.AxisLabel = username[x]; dp.YValues = new double[] { Convert.ToDouble(average[x]) }; dp.Label = average[x].ToString() + " || " + count[x]; dp.LabelForeColor = Color.DarkGreen; dp.Font = new System.Drawing.Font(FontFamily.GenericSerif, 10, FontStyle.Bold); Chart1.Series["currmonth"].Points.Add(dp); //----------------------------------- DataPoint dp2 = new DataPoint(); dp2.AxisLabel = username2[x]; //dp.XValue = x; dp2.YValues = new double[] { Convert.ToDouble(average2[x]) }; dp2.Label = average2[x].ToString() + " || " + count2[x]; dp2.LabelForeColor = Color.Brown; dp2.Font = new System.Drawing.Font(FontFamily.GenericSerif, 10, FontStyle.Bold); Chart1.Series["prevmonth"].Points.Add(dp2); x++; } Chart1.Palette = ChartColorPalette.BrightPastel; Chart1.Titles[0].Text = "Name"; Chart1.ChartAreas[0].AxisX.Title = ddlMonths.SelectedValue; Chart1.ChartAreas[0].AxisY.Title = "$"; Chart1.Legends.Add(new Legend() { Name = "Legend" }); Chart1.Legends[0].Docking = Docking.Bottom; Chart1.Series["currmonth"].Name = "Current Month"; Chart1.Series["prevmonth"].Name = "Previous Month"; Chart1.Series["compgoal"].Name = "Company Goal"; //------------------------------------------------------------------------- </code></pre> <p>any help is appreciated! </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload