javascript - Declarative 2D columns type dojo chart (custom axis label) -


i'm new dojo charting. i'm using dojo version 1.6.

i need create 2d chart custom x axis labels.

for have written below code

<div dojotype="dojox.charting.widget.chart2d" id="chart1" style="width: 300px; height: 300px;"      theme="dojox.charting.themes.miaminice">         <div class="axis" name="x" font="italic normal normal 8pt tahoma" fixupper="major" > <!-- --> </div>         <div class="axis" name="y" vertical="true" fixupper="major" includezero="true" font="italic normal normal 8pt tahoma"><!-- --></div>         <div class="plot" name="default" type="columns" markers="true" gap="4"><!-- --></div>         <div class="action" type="tooltip"><!-- --></div>         <div class="series" name="run a" data="10, 20, 30, 40, 50, 60, 70"><!-- --></div>         <div class="action" type="highlight"><!-- --></div>         <div class="action" type="shake" shiftx="1" shifty="1"><!-- --></div> </div> 

which working fine.

now issue don't know how give customise axis labels in declarative way. searched on net regarding this, no luck.

please help!

you'll need create labels somewhere in javascript this:

labels = [     {value: 1, text: "one"},     {value: 2, text: "two"},     {value: 3, text: "three"} ] 

then change axis line this:

<div class="axis" name="x" font="italic normal normal 8pt tahoma" fixupper="major" labels="labels"> <!-- --> </div> 

to able listen chart events, can this:

chart.connecttoplot("default", function(evt) {   var type  = evt.type;    if(type=="onclick") {     //do here   } }); 

Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -