Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplay Custom Label from data store with dojox.charting
    primarykey
    data
    text
    <p>I am using the <code>dojox.charting.widget.Chart2D</code> and I am trying to retrieve the data from an <code>dojo.data.ItemFileReadStore</code>. I can retrieve the data, and everything works and displays, except I cannot seem to find a way to display custom labels on the items. My HTML snippet is:</p> <pre><code>&lt;div dojoType="dojo.data.ItemFileReadStore" jsId="chartDataStore" url="json/archiveinfo.json.php"&gt;&lt;/div&gt; &lt;div dojoType="dojox.charting.widget.Chart2D" id="chartTest" theme="dojox.charting.themes.PlotKit.blue" style="width: 300px; height: 300px;"&gt; &lt;div class="plot" name="default" type="Pie" fontColor="black" htmlLabels="false" radius="100"&gt;&lt;/div&gt; &lt;div class="series" name="Series A" store="chartDataStore" field="y" label="text" valueFn="Number(x)"&gt;&lt;/div&gt; &lt;div class="action" type="Tooltip"&gt;&lt;/div&gt; &lt;div class="action" type="MoveSlice"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>And my JSON from the ItemFileReadStore is:</p> <pre><code>{"identifier":"id","labelAttribute":"text","items": [ {"id":1,"y":55,"text":"Free"}, {"id":2,"y":45,"text":"Used"} ] } </code></pre> <p>I have tried setting the label attribute in the series and have set the <code>labelAttribute</code> in the JSON. I also tried just <code>label</code> in the JSON and it didn't work either. When I provide the data as a JSON in an <code>array</code> or provide the <code>data</code> directly in the series, I get the labels to work. I really wanted to make it more flexible though by providing the data via a DataStore.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload