Topic: Setting Chart background

itay pro asked 6 years ago


Regarding: https://mdbootstrap.com/angular/advanced/charts How can I set the chart's background as I did with jQuery ? https://imgur.com/a/riUGwZR

itay pro commented 6 years ago

How can I set the labels colors and fonts ? Is there a schema for the chart options ?

itay pro answered 6 years ago


Just saw your answer by accident Thanks

Damian Gemza staff answered 6 years ago


Dear mdb2, In this way you can change the axis colors,
public chartOptions: any = {

    responsive: true,

    scales: {

      xAxes: [{

        gridLines: {

          color: 'rgba(100, 100, 100, 1.0)'

        },

        scaleLabel: {

          display: true,

          labelString: 'Label 2',

          fontColor: 'blue'

        }

      }],

      yAxes: [{

        gridLines: {

          color: 'rgba(100, 100, 100, 1.0)'

        },

        scaleLabel: {

          display: true,

          labelString: 'Label 1',

          fontColor: 'red'

        }

      }],




    }

  };
Best Regards, Damian

itay pro answered 6 years ago


Thanks, Just found this answer by accident as I don't receive email notifications and cannot search for my questions Can you please point me to the documentation ? How can I change the axis labels' color ?  

Damian Gemza staff answered 6 years ago


Dear mdb2, You can set labels font color by using labels options object. Please take a look at below code to see, how you can change the font color in labels.
public chartOptions: any = {

responsive: true,

legend: {

    labels: {

        fontColor:'red'

    }

  }

};
Best Regards, Damian

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 6.2.2
  • Device: NA
  • Browser: NA
  • OS: NA
  • Provided sample code: No
  • Provided link: No
Tags