jquery - Adding legends and y-axis value on sparkline bar charts -
i working on sparklines bar graph. until able draw simple bar graph, here jquery code:
values = [0,8, 15, 10, 50, 25, 35, 70]; $('.sparkline').sparkline(values, { type: 'bar', height: '200px', barwidth: 20, barspacing: 10, barcolor: '#56aaff', zerocolor: '#000000', enabletagoptions: true, tagvaluesattribute: 'data-values', colormap: ["red", "green", "blue", "yellow", "orange", "#f2f2f2", "maroon", "pink"] });
html
<p> <span class="sparkline">loading...</span> </p>
please refer code @ jsfiddle .
now want add legends name value of y-axis on each of bar shown below.
sun,mon,tue legends , value on white color @ top of bars y-axis value.
but not able achieve it.
any appreciated.
the more pointing sparkline's faq:
http://omnipotent.net/jquery.sparkline/#s-faq
frequently asked questions
why there no axis labels/markers?
sparklines intended small enough fit alongside line of text, give quick impression of trend or pattern , don't have paraphernalia of full sized charts. of version 2.0 can mouse on sparklines see underlying data.
Comments
Post a Comment