Why my Gantt chart only display one bar for one category?

Hi guys,

I need assistance about the Charts Add-on for Cuba.

I tried to do something very simple with the following Data Model :

  • Task Span Entity (Contains Category and have One to Many Link with Task)
  • Task Entity (contains Task Name / Start / Finish / Color)

I create a Gantt on Screen, with the following XML :

    <chart:ganttChart id="taskSpanGanttChart"
                      additionalSegmentFields="name"
                      balloonDateFormat="JJ:NN"
                      brightnessStep="7"
                      categoryField="category"
                      colorField="color"
                      columnWidth="0.5"
                      dataContainer="taskSpansDc"
                      endDateField="finish"
                      height="50%"
                      marginRight="70"
                      period="DAYS"
                      rotate="true"
                      segmentsField="task"
                      startDate="2018-01-01"
                      startDateField="start"
                      theme="LIGHT"
                      width="100%">
        <chart:graph balloonText="&lt;strong&gt;[[name]]&lt;"
                     fillAlphas="1"/>
    <chart:valueAxis type="DATE"/>
    <chart:valueScrollbar autoGridCount="true"
                          color="BLACK"/>
    <chart:chartCursor cursorAlpha="0"
                       cursorColor="#55bb76"
                       fullWidth="true"
                       valueLineAlpha="0.5"
                       valueBalloonsEnabled="false"
                       valueLineBalloonEnabled="true"
                       valueLineEnabled="true"
                       valueZoomable="true"
                       zoomable="false"/>
    <chart:export/>
</chart:ganttChart>

However I can only see one gantt bar even if I have in my use case 2 Categories & 2 Tasks.

Can you please help me ?

Attached to this issue a simple example.

Kind regards,Cat_2 Gantt_Chart

Paul.

reporting_draft.zip (12.6 MB)

Hi, @pa.bonlieu !

Thank you for the demo project, we will try to investiage your issue.

Hi!

Take a look at taskSpan-view. It loads TaskSpan with Task list. Every Task contains TaskSpan which loads list of tasks again - this is the main problem.

You need to remove task in taskSpan property:

<view entity="reporting$TaskSpan" name="taskSpan-view" extends="_local">
    <property name="task" view="_minimal">
        <property name="start"/>
        <property name="finish"/>
        <property name="duration"/>
        <property name="color"/>
        <property name="taskSpan" view="_minimal"/>
    </property>
</view>

Also, there is a good command to zip project: gradlew zip. Use it if you need to share project.

1 Like

Hi Roman,

Excellent :slight_smile: !

Works nice,

Thank you for your time and the solution !

Kind regards,

Paul.

1 Like