English 中文(简体)
iReport 显示 x 轴上的标签过多
原标题:iReport displays too many labels on x axis

早上好!我对Jaspersoft i Report 4. 5. 0有问题,我希望得到一些帮助。基本上,当我显示一个xy 线条图表时,它试图在每个数据点的 X 轴上添加一个标签。我有近200个数据点,所以这最后看起来就像一条坚固的线,即使我调整了刻数标签的旋转或什么的。

我意识到对这一问题的一般回答是用一个时间序列图代替一个时间序列图。 这通常有效, 但以我而言, 我使用的是一个多轴图, 其对轴是条形图。 由于条形图没有时间序列的种类, iReport不允许我将条形图与时间序列图混在一起, 迫使我使用xy线图。

还有什么办法我可以吃我的蛋糕吗?我可以把一些标签过滤出去吗?或许可以限制在X轴上可以展示的标签数量?我还没有在互联网上看到一个明确答案!

Thanks in advance! - Ian

这是我要修改的多轴图表之一的 jrxml :

<multiAxisChart>
    <chart evaluationTime="Report" hyperlinkType="LocalAnchor">
        <reportElement x="42" y="441" width="440" height="292"/>
        <chartTitle position="Top">
            <titleExpression><![CDATA["CICS Elapsed"]]></titleExpression>
        </chartTitle>
        <chartSubtitle/>
        <chartLegend/>
        <anchorNameExpression><![CDATA["CICS Elapsed Small"]]></anchorNameExpression>
        <hyperlinkAnchorExpression><![CDATA["CICS Elapsed Big"]]></hyperlinkAnchorExpression>
        <hyperlinkTooltipExpression><![CDATA["Click to Enlarge"]]></hyperlinkTooltipExpression>
    </chart>
    <multiAxisPlot>
        <plot/>
        <axis position="leftOrTop">
            <lineChart>
                <chart>
                    <reportElement x="0" y="0" width="0" height="0" backcolor="#FFFFFF"/>
                    <chartTitle position="Top" color="#000000">
                        <titleExpression><![CDATA["CICS Elapsed"]]></titleExpression>
                    </chartTitle>
                    <chartSubtitle color="#000000"/>
                    <chartLegend textColor="#000000" backgroundColor="#FFFFFF"/>
                </chart>
                <categoryDataset>
                    <dataset>
                        <datasetRun subDataset="wmprod_cics"/>
                    </dataset>
                    <categorySeries>
                        <seriesExpression><![CDATA["Cpu Time"]]></seriesExpression>
                        <categoryExpression><![CDATA[$F{TIMESTAMP}]]></categoryExpression>
                        <valueExpression><![CDATA[$F{ELAPSTIME}]]></valueExpression>
                    </categorySeries>
                </categoryDataset>
                <linePlot isShowShapes="false">
                    <plot/>
                    <categoryAxisLabelExpression><![CDATA["Date/Time"]]></categoryAxisLabelExpression>
                    <valueAxisLabelExpression><![CDATA["Avg Elapsed Time (ms)"]]></valueAxisLabelExpression>
                </linePlot>
            </lineChart>
        </axis>
        <axis position="rightOrBottom">
            <barChart>
                <chart>
                    <reportElement x="0" y="0" width="0" height="0" backcolor="#FFFFFF"/>
                    <chartTitle position="Top" color="#000000">
                        <titleExpression><![CDATA["CICS Elapsed"]]></titleExpression>
                    </chartTitle>
                    <chartSubtitle color="#000000"/>
                    <chartLegend textColor="#000000" backgroundColor="#FFFFFF"/>
                </chart>
                <categoryDataset>
                    <dataset>
                        <datasetRun subDataset="wmprod_cics"/>
                    </dataset>
                    <categorySeries>
                        <seriesExpression><![CDATA["Volume (transactions)"]]></seriesExpression>
                        <categoryExpression><![CDATA[$F{TIMESTAMP}]]></categoryExpression>
                        <valueExpression><![CDATA[$F{TRANSCOMPL}]]></valueExpression>
                    </categorySeries>
                </categoryDataset>
                <barPlot>
                    <plot/>
                    <itemLabel/>
                    <valueAxisLabelExpression><![CDATA["Volume (transactions)"]]></valueAxisLabelExpression>
                </barPlot>
            </barChart>
        </axis>
    </multiAxisPlot>
</multiAxisChart>
问题回答

我也有同样的问题 我想答案是:

<chart>
  <reportElement x="0" y="0" width="802" height="215">
    <property name="net.sf.jasperreports.chart.domain.axis.tick.interval" value="1"/>
  </reportElement>

酌情设置刻度间隔。 注意: 我的图表是一个散射图。 未用行图测试 。





相关问题
Using a POJO as an iReport data source

I have a POJO that compiles data from various sources into a single object. The object is instantiated with a single parameter. Example: Invoice inv=new Invoice(1239); This will bring back a ...

Problem with auto page break in iReport

I m using iReport 3.7. I have a report with two subreports (order details and some selling statistics), and a grouping by seller. One subreport is located in the Detail band of the group, and the ...

How to truncate data (avoiding page break) in iReport?

I have a listing that must fit in a page. Instead of the default page break behaviour, I need iReport to truncate the listing when it goes over the page size. Any ideas? Thanks! EDIT: I ve had ...

How to prevent duplication of bar chart in iReport

I ve tried to use chart in iReport for the first time. I ve used a bar chart and anytime I preview the chart I see plenty of them, iIthink about 6. I only need a single one is there anything that I ...

Field Expression in iReport

I m trying to get myself used to iReport before using it in a real project next week and i seem to be stacked somewhere already. I m using iReport 3.7.0 on Windows XP platform + Java 1.6 It sound ...

热门标签