morrisjs / morris.js

Pretty time-series line graphs
http://morrisjs.github.com/morris.js/
6.92k stars 1.23k forks source link

How to change font size in donuts? #676

Closed butteff closed 7 years ago

butteff commented 8 years ago

Hello. By some reasons it don't work in js after donut render or after document(ready) function:

$('#server-donut').find('tspan').css('font-size', '6px !important'); 
$('#server-donut').find('text').attr('font-size', '6px'); 
$('#server-donut').find('text').css('font-size', '6px !important');

server-donut - div for morris rendering. With svg instead of this div nothing changes.

In standart css or in css in the end of the document:

<style>
    #server-donut svg text{
      font-size: 6px!important;
    }

    #server-donut tspan {
      font-size: 6px!important;
    }
</style>

Also, this js plugin (morris.js) has not got any callback functions in docs or any options for text.

Is it possible to change text size in easy mode?

A-Alaraj commented 7 years ago

I search alot about it, and i couldn't found a solution so I invented to put spaces inside names so it make more smaller like this {value: 70, label: ' \xa0 \xa0 Fahrrad \xa0 \xa0'}, {value: 15, label: ' \xa0 \xa0 Pedelecs \xa0 \xa0'}, {value: 10, label: ' \xa0 \xa0 S-Pedelecs \xa0 \xa0'},

and it works like magic