TradingPal / react-native-highcharts

📈 Add Highcharts charts to react-native app for IOS and Android
https://github.com/TradingPal/react-native-highcharts
255 stars 159 forks source link

How to pass html in title in the conf object. #89

Open Dgs-asohail4 opened 5 years ago

Dgs-asohail4 commented 5 years ago

I have this conf object. The only issue is with the title property. In the library function all the object is converted into string. During the process the ``` are being replaced by""` due to it does not render in the webview (as debug from chrome inspector). Any idea how to change the parser of how pass html to the title property of the object?

var conf = {
            chart: {
                renderTo: 'container',
                plotBackgroundColor: null,
                plotBackgroundImage: null,
                plotBorderWidth: 0,
                plotShadow: false,
                backgroundColor: 'transparent',
                style: {
                    // fontFamily: 'open sans',
                    color: '#556a78'
                }
            },
....
            title: {
                useHTML: true,
                text:`
                <span class="chart-content">
                    <span class="chart__title">KPI</span>
                    <span class="chart__score">`+surveyRatio+`<small>%</small></span>
                    <span class="chart__count">Closed loop count <span>`+count+`</span></span>
                </span>
            `,
                verticalAlign: 'middle',
                floating: false,
                size:'80%',
                align: 'center',
                y: -40,
                x: -5
            },
....
        };