c# - Charting Toolkit Custom Horizontal Axis values -


i plotting graph of frequency against loudness(decibels) using charting toolkit. horizontal axis frequency has values of 100, 250, 500,1000,2000,4000,6000, , 8000. when plot graph, horizontal axis shows frequency values according 'interval', stays same across x-axis. , x-axis values of different intervals. update: want line graph. here full code xaml is:

   <chartingtoolkit:chart name="linechart"         title="results">         <chartingtoolkit:lineseries name="mydata"             title="calculated data"               dependentvaluepath="value"              independentvaluepath="key"             itemssource="{binding [0]}"/>         <chartingtoolkit:chart.axes>             <chartingtoolkit:linearaxis                  orientation="y"                 minimum="0" maximum="80"                 title="loudness in db"                 interval="5" />             <chartingtoolkit:linearaxis name="xaxis"                 orientation="x"                 minimum="0" maximum="8000"                 title="frequency in hz"                 interval="500" />        </chartingtoolkit:chart.axes>    </chartingtoolkit:chart> 

and c# code is:

    private void showlinechart(mychartresult)  // mychartresult list of objects // each object has frequency , decibel field     {         var datasourcelist = new list<list<keyvaluepair<int, int>>>();          (int = 0; < mychartresult.count; i++)             datasourcelist.add(new keyvaluepair<int, int>                (mychartresult[i].frequency,                mychartresult[i].decibels));         linechart.datacontext = datasourcelist; } 

in graph, decibel values against 100 , 250 plotted horizontal axis doesn't show frequency values of 100 , 250. there way customize (in xaml or c#) x-axis labels can show values mentioned above?

use columnseries:

    <chartingtoolkit:chart margin="0" title="chart title">         <chartingtoolkit:chart.datacontext>             <local:mydatacollection/>         </chartingtoolkit:chart.datacontext>         <chartingtoolkit:columnseries dependentvaluepath="decibel" independentvaluepath="frequency" itemssource="{binding}"/>     </chartingtoolkit:chart> 

enter image description here


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -