Stacked Column Chart
Posted: Tue Oct 27, 2015 8:47 am
I am looking to create a stacked column chart and I'm struggling mentally. my data set is below.and I'm trying to figure out how to set it up in an array that the chart can use.
This is a snippet of the code. If you need more to see what I'm doing I can add to it.
# add data to chart
$Cities = @{London=7556900; Berlin=3429900; Madrid=3213271; Rome=2726539; Paris=2188500}
[void]$Chart.Series.Add("Data")
$Chart.Series["Data"].ChartType = [System.Windows.Forms.DataVisualization.Charting.SeriesChartType]::stackedcolumn
$Chart.Series["Data"].Points.DataBindXY($Cities.Keys, $Cities.Values)
Operator OpCount dt
George 5 10/20/2015 12:00:00 AM
George 6 10/21/2015 12:00:00 AM
George 2 10/22/2015 12:00:00 AM
George 3 10/23/2015 12:00:00 AM
George 5 10/26/2015 12:00:00 AM
Sam 5 10/20/2015 12:00:00 AM
Sam 3 10/21/2015 12:00:00 AM
Sam 6 10/22/2015 12:00:00 AM
Sam 4 10/23/2015 12:00:00 AM
Sam 3 10/26/2015 12:00:00 AM
Sarah 6 10/20/2015 12:00:00 AM
Sarah 8 10/21/2015 12:00:00 AM
Sarah 6 10/22/2015 12:00:00 AM
Sarah 5 10/23/2015 12:00:00 AM
Sarah 7 10/26/2015 12:00:00 AM
This is a snippet of the code. If you need more to see what I'm doing I can add to it.
# add data to chart
$Cities = @{London=7556900; Berlin=3429900; Madrid=3213271; Rome=2726539; Paris=2188500}
[void]$Chart.Series.Add("Data")
$Chart.Series["Data"].ChartType = [System.Windows.Forms.DataVisualization.Charting.SeriesChartType]::stackedcolumn
$Chart.Series["Data"].Points.DataBindXY($Cities.Keys, $Cities.Values)
Operator OpCount dt
George 5 10/20/2015 12:00:00 AM
George 6 10/21/2015 12:00:00 AM
George 2 10/22/2015 12:00:00 AM
George 3 10/23/2015 12:00:00 AM
George 5 10/26/2015 12:00:00 AM
Sam 5 10/20/2015 12:00:00 AM
Sam 3 10/21/2015 12:00:00 AM
Sam 6 10/22/2015 12:00:00 AM
Sam 4 10/23/2015 12:00:00 AM
Sam 3 10/26/2015 12:00:00 AM
Sarah 6 10/20/2015 12:00:00 AM
Sarah 8 10/21/2015 12:00:00 AM
Sarah 6 10/22/2015 12:00:00 AM
Sarah 5 10/23/2015 12:00:00 AM
Sarah 7 10/26/2015 12:00:00 AM