Skip to main content

Stacked clustered Bar.Series option?

Comments

4 comments

  • VISUI

    Johnny, 
    As far as I know Logi hasn't exposed hierarchical categorization along the x-Axis.  I actually think there is a Highcharts plugin that will provide exactly what you want, but it is not easy to implement.

    The closest thing you will probably be able to get with Info out-of-the-box is to use a Crosstab chart with a Calculated column returning a concatenation of DatePeriod and Room used as the Label Column in the Crosstab Filter

    Your chart would be defined as follows:

    <ChartCanvas>
    <DataLayer Type="XMLFile" XMLFile="newXMLFile.xml" ID="ChartQuery">
    <Remark>
    <DataLayerLink ID="dllData" />
    </Remark>
    <CalculatedColumn Formula="&quot;@Data.Room~&lt;br&gt;@Data.DatePeriod~&quot;" ID="Room-Date" />
    <CrosstabFilter CrosstabColumn="EStatus" CrosstabLabelColumn="Room-Date" CrosstabValueColumn="EncounterNbr" CrosstabValueFunction="DistinctCount" />
    </DataLayer>
    <Series Type="Bar" ChartYDataColumn="rdCrosstabValue" ChartXDataColumn="rdCrosstab" BarStacking="Stacked" />
    <ChartXAxis>
    <AxisLabelStyle Format="HTML" />
    </ChartXAxis>
    </ChartCanvas>

    I think this is what you are actually looking for:  http://blacklabel.github.io/grouped_categories/ 

    Where in this example the Fruit,Vegetable,Fish would be your Date Grouping then within each Date Group you would have your normal stacked bars for each room by EStatus.

    We could probably help you out some more if interested.
    johns@visuidesign.com

    2
  • Johnny Stevens

    Wow... Another kick-#$s Solution from Sweazen!!
    Shout out to VISUI

    I'm going with a hybrid of your first recommendation where I'm concatenating DatePeriod+Room (but only showing Room in the Label) and a separate XAxis showing DatePeriod. The issue that I'm seeing is that the secondary XAxis (DatePeriod) is evenly spaced across the available DatePeriod values (width of chart divided by '5' in this case) while my DatePeriod+Room values in the primary XAxis is spaced based on the available data. This leaves the XAxes misaligned as you can see with TicksAndGrids added here. I need the XAxis for DatePeriod to show Gridlines after the last value in each DatePeriod+Room set, so it should fall after "Zeego-Rm1":

    Any ideas on how to align these Axes more closely? There will regularly be situations in the data where the Rooms won't be so evenly spaced across DatePeriods; 11, 11, 11, 10, 10 in the above example could easily be 6, 1, 3, 1, 6 which would make the evenly spaced DateOverlay Axis even further off.

    <ChartCanvas>
    <Series Type="Bar" ChartYDataColumn="rdCrosstabValue" ChartXDataColumn="RoomNoDate" BarStacking="Stacked" Color="@Chart.rdCrosstabValue-BarColor~" ID="SeriesBarData" LinkedToXAxisID="BarData">
    <DataLayer Type="XMLFile" XMLFile="OTEDataSortedByRoom.xml" ID="ChartQuery">
    <CalculatedColumn Formula="&quot;@Data.DatePeriod~ @Data.Room~&quot;" ID="Date-Room" />
    <SortFilter SortColumn="DoS,Room" />
    <CrosstabFilter CrosstabColumn="EStatus" CrosstabLabelColumn="Date-Room" CrosstabValueColumn="EncounterNbr" CrosstabValueFunction="Count" ID="ctfGroupedData">
    <ExtraCrosstabValueColumn CrosstabValueColumn="BarColor" CrosstabValueFunction="Any" ID="BarColor" />
    <ExtraCrosstabLabelColumn CrosstabLabelColumn="Room" ID="RoomNoDate" />
    </CrosstabFilter>
    </DataLayer>
    </Series>
    <Series BarStacking="Overlay" ChartXDataColumn="DatePeriod" ChartYDataColumn="yval" Color="#FFF" LinkedToXAxisID="DateOverlay" Type="Bar" ID="SeriesDateOverlay" LegendLabel=" ">
    <DataLayer ID="ChartQueryOverlay" Type="XMLFile" XMLFile="OTEDataSortedByRoom.xml">
    <SortFilter DataType="Date" SortColumn="DoS" />
    <CrosstabFilter CrosstabColumn="Room" CrosstabLabelColumn="DatePeriod" CrosstabValueColumn="EncounterNbr" CrosstabValueFunction="Count" ID="ctfGroupedOverlay" />
    <CalculatedColumn Formula="0" ID="yval">
    <Note Note="set the yAxis val to zero " />
    </CalculatedColumn>
    </DataLayer>
    </Series>
    <ChartXAxis ID="BarData">
    <AxisLabelStyle FontAngle="90" FontSize="10" />
    </ChartXAxis>
    <ChartXAxis ID="DateOverlay">
    <AxisLabelStyle FontAngle="35" FontSize="12" />
    <ChartTicksAndGrid />
    </ChartXAxis>
    <ChartCanvasLegend LegendOrientation="Vertical" ReversedItemOrder="True" OffsetX="-10">
    <LegendLabelStyle FontSize="12" />
    </ChartCanvasLegend>
    </ChartCanvas>

    Regards,
    Johnny

    1
  • Johnny Stevens

    Hey John,

    It occurred to me that this is a simple matter of getting the XAxis segments to align with the Count of Rooms per DatePeriod. The SeriesDateOverlay doesn't even need the CrosstabFilter... once we group by DatePeriod and get the Ct of Rooms per DatePeriod, we want the 'length' of each DatePeriod 'segment' on the XAxis to correspond to those values.

    I have the following Bar.Series and XAxis for this:
    <Series BarStacking="Overlay" ChartXDataColumn="DatePeriod" ChartYDataColumn="yval" Color="#FFF" LinkedToXAxisID="DateOverlay" Type="Bar" ID="SeriesDateOverlay" LegendLabel=" ">
    <DataLayer ID="ChartQueryOverlay" Type="XMLFile" XMLFile="OTEDataSortedByRoom.xml">
    <GroupFilter GroupColumn="DatePeriod" ID="grpDatePer">
    <GroupAggregateColumn AggregateColumn="Room" AggregateFunction="DistinctCount" ID="ctRoomsPerPeriod" />
    </GroupFilter>
    <SortFilter DataType="Date" SortColumn="DoS" ID="sortDoS" />
    <CalculatedColumn Formula="0" ID="yval">
    <Note Note="set the yAxis val to zero " />
    </CalculatedColumn>
    </DataLayer>
    </Series><ChartXAxis ID="DateOverlay">
    <AxisLabelStyle FontAngle="35" FontSize="12" />
    <Remark>
    <ChartTicksAndGrid />
    </Remark>
    </ChartXAxis>

    How do I get the length of each DatePeriod segment of the XAxis to correspond to the ctRoomsPerPeriod value (using the earlier XML data - 11, 11, 11, 10, and 10 respectively)?

    Thanks,
    Johnny

    0
  • Johnny Stevens

    Just to keep everyone updated... we are contracting with VISUI and John Sweazen for this integration work.

    0

Please sign in to leave a comment.