fusioncharts / react-native-fusioncharts

Simple and Lightweight React Native component for FusionCharts JavaScript Charting Library
https://fusioncharts.github.io/react-native-fusioncharts
MIT License
80 stars 36 forks source link

Different legend icons for msline and mscolumn2d with the same configuration #126

Closed osvald0 closed 3 years ago

osvald0 commented 3 years ago

msline and mscolumn2d charts legend icons looks different with similar configuration.

msline configuration:

{
    theme: 'fusion',
    numberPrefix: '$',
    bgColor: styles.charBackgroundColor,
    canvasbgColor: styles.charBackgroundColor,
    toolTipBgColor: styles.charBackgroundColor,
    toolTipColor: styles.text,
    divLineColor: styles.divLine,
    baseFontColor: styles.text,
    outCnvBaseFontSize: 10,
    chartLeftMargin: 0,
    chartTopMargin: 10,
    chartRightMargin: 10,
    // legend configuration.
    legendIconSides: 1,
    legendIconScale: 0.6,
    legendItemFontSize: 10,
    legendItemFontColor: styles.text,
    legendIconBgAlpha: 0,
  }

mscolumn2d configuration:

{
    theme: 'fusion',
    numberPrefix: '$',
    bgColor: styles.charBackgroundColor,
    canvasbgColor: styles.charBackgroundColor,
    toolTipBgColor: styles.charBackgroundColor,
    toolTipColor: styles.text,
    divLineColor: styles.divLine,
    baseFontColor: styles.text,
    outCnvBaseFontSize: 10,
    chartLeftMargin: 0,
    chartTopMargin: 10,
    chartRightMargin: 0,
    // legend configuration.
    legendIconSides: 1,
    legendIconScale: 0.6,
    legendItemFontSize: 10,
    legendItemFontColor: styles.text,
  }

msline

mscolumn2d

AyanBhadury commented 3 years ago

@osvald0 As per your given query would suggest you follow the below-given steps.

Set the legendIconBgAlpha to 100.

Set the "anchorBgColor" in your dataset with your required color hex codes.

In msline, the legends are based on the anchors in the data plot and as per your given sample code, the anchors appear to be blank hence, the labels were blank as well.

Please find the link to a working sample: http://jsfiddle.net/rs7fu0La/1/

osvald0 commented 3 years ago

It works fine. Thanks!