cancel
Showing results for 
Search instead for 
Did you mean: 

Stacked Bar - unable to display a bar for each day on x-axis

0 Kudos

I am trying to create a stacked bar chart with a bar for each day's downtime data. Date on the X axis and ElapsedTime (stacked) on the Y axis. The chart appears to work for 1 or 2 days but fails to give me a bar for each day when the number of days returned > 2. Not sure if the bar chart requires the data to be stacked to be returned in different columns or do i have the display template setup improperly. Help

data -

DowntimeReason,EndDateTimeShift,ElapsedTime

Reason5,11/18/2007,86400

Tool Change,11/19/2007,3849

Reason5,11/19/2007,589

Reason4,11/19/2007,493

Machine Down,11/19/2007,380

Reason3,11/19/2007,4

Tool Change,11/20/2007,172

Reason3,11/20/2007,5

display template -

<?xml version="1.0" encoding="UTF-8"?><iChart AxisLabelColumns="EndDateTimeShift" AxisValueColumn="EndDateTimeShift" BarGroupSpacing="2" BarMarginSpacing="0" BarSpacing="1" ChartBackgroundColor="#C0C0C0" ChartBorderColor="#C0C0C0" ChartType="StackedBar" EnableDisplayTemplateLoad="true" EnableDisplayTemplateSave="true" EnableQueryTemplateLoad="true" EnableQueryTemplateSave="true" GlobalAutoScale="true" GlobalDecimals="0" GlobalMaxRange="120.0" HorizontalGridColor="#CE6523" InitialUpdate="false" InterpolateLines="false" LabelColumns="DowntimeReason" LegendBackgroundColor="#EAEAEA" LegendBorderColor="#EAEAEA" LegendDescriptionLabel="" LegendLabelColor="#000000" LegendSelectionBorderColor="#EAEAEA" LegendWidth="15" MainBackgroundColor="#EAEAEA" MainBorderColor="#EAEAEA" MaxRange.1="120.0" PenColor.1="#BE64FF" PenColor.2="#940044" PenColor.3="#FFFF9B" PenColor.4="#60FFF0" PenColor.6="#FF0000" SaveDate="11/20/2007 11:05:26" ShowHorizontalGrid="false" ShowTagDescription="false" ShowTimeControl="false" ShowVerticalGrid="false" TitleColor="#D17900" TitleFontSize="12" TitleFontStyle="1" UseGlobalDecimals="true" ValueColumns="ElapsedTime" Version="11.5.3" VerticalGridColor="#CE6523" XAxisDateFormat="MM/dd" XAxisFontSize="10" XAxisLabelColor="#000000" XAxisMajorTickCount="1" XAxisMinorTickCount="1" XAxisNumberFormat="0" XAxisShowLabels="false" XAxisTickColor="#EAEAEA" XAxisTickHighlightColor="#EAEAEA" XAxisTicksPerLabel="1" XAxisTimeFormat="" XAxisWidth="10" YAxisDateFormat="MM-dd" YAxisFontSize="10" YAxisLabelColor="#000000" YAxisNumberFormat="0" YAxisTickColor="#EAEAEA" YAxisTickHighlightColor="#FFFFFF" YAxisTicksPerLabel="1" YAxisUsePenColor="false" ZeroBasedScale="true"/>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You need to "interpolate" the dataset to ensure that each date/reason combination has a value, even if that value is zero.

0 Kudos

Rick, do the different reasons need to be in a different column on the same row

date1, reason1Time, reason2Time, reason3Time

date2, reason1Time, reason2Time, reason3Time

or can the data have the original schema where the dates have reasons in different rows

date1, reason1, time

date1, reason2, time

date1, reason3, time

date2, reason1, time

...

Thanks

sam

Former Member
0 Kudos

No, they don't have to be separate columns.

If you use the data mapping tab in the display template editor, you can assign the reason code column to the "Label Column", and the date column to the "Axis Label Column", and the time column to the "Value Column".

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Bassam,

I feel that the problem is with your query template. Are you able to segregate the result based on days in query template??