如何使用折线图-JasperReport 避免 "line breaking up"?

How can I avoid "line breaking up" with line chart-JasperReport?

我正在使用 Jaspersoft Studio 6.3 版。0.final 和 JasperReports Library 6.3.0 版。我正在创建一个具有不同系列和类别值的折线图。我的问题是,在绘制图表时,我观察到如果对于一个类别没有特定系列的值,则该线会中断并且该线会从下一个数据点重新开始。

有没有办法连接一个特定系列中的所有点,使其成为一条连续的单线而不是虚线和点?

我放了一张图片作为我得到的和我想做的事的例子,还有我的折线图的 .jrxml 文件。

line chart example

<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="chart_subreport" pageWidth="842" pageHeight="595" columnWidth="842" leftMargin="0" rightMargin="0" topMargin="10" bottomMargin="10"> 
<style name="table 1_TH" mode="Opaque" backcolor="#646464" forecolor="#FFFFFF" >
    <box>
        <pen lineColor="#969696" lineWidth="1.0"/>
    </box>
</style>    

<field name="TimePoints" class="java.util.Date"/>
<field name="LongAxis" class="java.lang.Double"/>
<field name="Lesion" class="java.lang.String"/>

<detail>
 <band height="400" >
                <printWhenExpression><![CDATA[$V{REPORT_COUNT}==1]]></printWhenExpression>                    
        <lineChart>
            <chart>
                <reportElement  style="table 1_TH" x="10" y="0" width="800" height="400"/>                  
                <chartTitle>
                    <titleExpression><![CDATA["Lesion's evolution"]]></titleExpression>
                </chartTitle>                                                       
            </chart>                
            <categoryDataset>
                <categorySeries>
                <!-- This is the lesions you want to see on charts-->
                    <seriesExpression><![CDATA[$F{Lesion}]]></seriesExpression>
                    <!--You can change the format date here -->
                    <categoryExpression><![CDATA[(new SimpleDateFormat("MMM d, yyyy")).format($F{TimePoints})]]></categoryExpression>
                    <valueExpression><![CDATA[$F{LongAxis}]]></valueExpression>
                </categorySeries>
            </categoryDataset>                                          
                <linePlot isShowLines="true">
                <plot backcolor="#323232"  />
                <categoryAxisFormat>
                    <axisFormat/>
                </categoryAxisFormat>
                <valueAxisFormat>
                  <axisFormat >
                    <labelFont>
                        <font fontName="Arial" size="10"/>
                    </labelFont>
                </axisFormat>
                </valueAxisFormat>
            </linePlot>             
        </lineChart>    
    </band>
</detail>
</jasperReport>

我得到了我想要的,我刚刚改变了图表的类型,现在我正在使用"timeSeriesChart"。

<style name="table 1_TH" mode="Opaque" backcolor="#646464" forecolor="#FFFFFF" >
    <box>
        <pen lineColor="#969696" lineWidth="1.0"/>
    </box>
    </style>    
<queryString>
    <![CDATA[]]>
</queryString>

<field name="TimePoints" class="java.util.Date"/>
<field name="LongAxis" class="java.lang.Double"/>
<field name="Lesion" class="java.lang.String"/>
<field name ="nbInstance" class="java.lang.Integer"/>

<detail>
 <band height="400" >
                <printWhenExpression><![CDATA[$V{REPORT_COUNT}==$F{nbInstance}]]></printWhenExpression>               
        <timeSeriesChart>
            <chart>
                <reportElement  style="table 1_TH" x="10" y="0" width="800" height="400"/>                  
                <chartTitle>
                    <titleExpression><![CDATA["Lesion's evolution"]]></titleExpression>
                </chartTitle>                                                       
            </chart>            

            <timeSeriesDataset>

                <timeSeries>
                    <seriesExpression><![CDATA[$F{Lesion}]]></seriesExpression>
                    <timePeriodExpression> <![CDATA[$F{TimePoints}]]></timePeriodExpression>
                        <valueExpression><![CDATA[$F{LongAxis}]]></valueExpression>
                </timeSeries>
            </timeSeriesDataset>                
                <timeSeriesPlot >
                <plot backcolor="#323232"  />
                <timeAxisLabelExpression/>                  
                <timeAxisFormat>
                    <axisFormat/>
                </timeAxisFormat>
                <valueAxisLabelExpression/>
                <valueAxisFormat>
                    <axisFormat/>
                </valueAxisFormat>
            </timeSeriesPlot>               
        </timeSeriesChart>  
    </band>
</detail>