mardi 14 juin 2016

morris js unlimited xKeys with asp.net mvc

I'm trying to draw multi dimensional bar chart with morris js in asp.net mvc.

My json result looks like

enter image description here

"CalismaTip" is Exam Type. And tearchers selecting learning types for all exam types. I am storing learing types in "Ciktilar" as you can see in the picture. And percentage in "CiktiOran".

So I want to use exam types as xKey in morris chart. And learning types as yKeys. But I don't know how to set sub array in json as yKeys.

Morris js does not have enough example. I am open for suggestions for more advanced chart framework.

I am using this code but it's not showing yKeys.

$.post("/Ders/DersRapor/GetirGenelOCBasariJson", { dersGrupID: '@dersGrupID', payIDList: '@payID' })
 .success(function (json) {
     console.log(json);

     Morris.Bar({
         element: 'bar-grafik',
         data: json,
         xkey: 'CalismaTip',
         ykeys: ['yKeys'],
         labels: ['yKeys']
     });
 });

Aucun commentaire:

Enregistrer un commentaire