morrisjs / morris.js

Pretty time-series line graphs

Home Page:http://morrisjs.github.com/morris.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Morris.js need to remove the below colored area ... or to remove the 0 from y-axis

bilaalshah opened this issue · comments

Currently its showing like
whatsapp image 2018-02-22 at 1 51 39 pm

I want to remove the below colored area or to remove the 0 from the y-axis

and to show like this
whatsapp image 2018-02-20 at 6 50 36 pm

Hello,

I think you need to use jQuery to change the fill of the last but one path. I just made some tests in Google Chrome developper tools and it seems this approach should work

image

Hmmm let me try it ...

Basically when i add the background color

lineColors:['#15486D','#f1b01d','#333f48'],

then test and check the chorme developer it automatically change that last row color

Right now i have put #333f48 as the last value color and the background color .. but as i check it chorme developer it automatically change the color

Please wait, I will try to add this option to my fork as I think such kind of charts is interesting

Hello,

Please check the master of my fork (https://github.com/pierresh/morris.js), I just implemented these 2 options for area charts:

  • belowArea (default true)
  • areaColors (default same as lineColors)

Below is the result with this configuration:

    Morris.Area({
      element: 'chart_line_1',
      data: [
        {year: '1958', nb: 1, b: 1, c: 2},
        {year: '1962', nb: 2, b: 3, c: 4},
        {year: '1970', nb: 3, b: 4, c: 5},
        {year: '1994', nb: 4, b: 5, c: 6},
        {year: '2002', nb: 5, b: 6, c: 7},
      ],
      xkey: 'year',
      ykeys: ['nb', 'b', 'c'],
      labels: ['nb', 'b', 'c'],
      belowArea: false,
      areaColors: ['#2b416d'],
      lineColors: ['#2b416d', '#f2ffa8', '#2b416d'],
      lineWidth: [0,3,0],
      pointSize: 0,
      dataLabels: false
    });

image

wwooowwwww ... let meee try ... :D :D

THUMPS UP ... Thanks