Jump to content
We've recently updated our Privacy Statement, available here ×

Help with simple bar chart


ncuneo

Recommended Posts

Hello, I'm playing around with Jaspersoft  Studio and am trying to test it out by  creating a simple bar chart.  I imported some data from wikipedia to play with and am just trying to make a bar chart with actions performed by different users.  Ideally, the y axis would have a count of actions and the x axis will be different bars for different actions for each user with a count of how many times that user performed that action.

The problem I'm running into is that when I create a bar chart, it seems to only want to show a running total of all of the actions performed, so the last user always has totals at the limit of my data while the first user seems to have an accurate count.

I've tried messing with the 'Increment on" and "Reset on" options in the chart data config but I can't seem to get it to reset the counters for each column, everything I set always  results in a running total.

I've also tried setting my value to $V{COLUMN_COUNT} and $V{REPORT_COUNT}, but both have the same effect.

 

Here's my bar chart code if it's helpful

<barChart>
                <chart evaluationTime="Column" renderType="svg" theme="aegean">
                    <reportElement isPrintRepeatedValues="false" x="0" y="0" width="572" height="460" uuid="ef1c289a-a5c2-47c9-864c-3c83b654fdd7"/>
                    <chartTitle>
                        <font fontName="DejaVu Serif"/>
                        <titleExpression><![CDATA["User Actions"]]></titleExpression>
                    </chartTitle>
                    <chartSubtitle/>
                    <chartLegend/>
                </chart>
                <categoryDataset>
                    <dataset resetType="Column"/>
                    <categorySeries>
                        <seriesExpression><![CDATA[$F{action}]]></seriesExpression>
                        <categoryExpression><![CDATA[$F{username}]]></categoryExpression>
                        <valueExpression><![CDATA[$V{COLUMN_COUNT}]]></valueExpression>
                        <labelExpression><![CDATA[$F{action}]]></labelExpression>
                    </categorySeries>
                </categoryDataset>
                <barPlot>
                    <plot>
                        <seriesColor seriesOrder="0" color="#299ECB"/>
                        <seriesColor seriesOrder="1" color="#F3519C"/>
                        <seriesColor seriesOrder="2" color="#F53B4B"/>
                        <seriesColor seriesOrder="3" color="#1FD352"/>
                        <seriesColor seriesOrder="4" color="#F5265D"/>
                        <seriesColor seriesOrder="5" color="#8EC7AD"/>
                        <seriesColor seriesOrder="6" color="#198AC9"/>
                        <seriesColor seriesOrder="7" color="#F6999D"/>
                        <seriesColor seriesOrder="8" color="#16CBD3"/>
                        <seriesColor seriesOrder="9" color="#5C3BE3"/>
                        <seriesColor seriesOrder="10" color="#AAF471"/>
                        <seriesColor seriesOrder="11" color="#1F7EDE"/>
                        <seriesColor seriesOrder="12" color="#20155F"/>
                        <seriesColor seriesOrder="13" color="#709A78"/>
                        <seriesColor seriesOrder="14" color="#D5036A"/>
                        <seriesColor seriesOrder="15" color="#E4D8B6"/>
                    </plot>
                    <itemLabel color="#FFFFFF" backgroundColor="#000000"/>
                    <categoryAxisLabelExpression><![CDATA["Username"]]></categoryAxisLabelExpression>
                    <categoryAxisFormat>
                        <axisFormat>
                            <labelFont>
                                <font fontName="DejaVu Sans"/>
                            </labelFont>
                        </axisFormat>
                    </categoryAxisFormat>
                    <valueAxisLabelExpression><![CDATA["Actions"]]></valueAxisLabelExpression>
                    <valueAxisFormat>
                        <axisFormat/>
                    </valueAxisFormat>
                </barPlot>
            </barChart>

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...