0

I am using jQchart to display a graph. However, the title property seems to display only a single line of text. Currently, the graph displays the following title:

 text: chartTypeText + ': ' + chartTitle + ", " + $('#baselineResidentialLocationCity option:selected').text() + ', ' + $("#baselineResidentialLocationState option:selected").val() + '    ' + $('#baselineResidentialStandardYear option:selected').text() + '   ' + baselinePeriod + ' year'

However, I basically need to display each variable on a different line (hopefully use linebreaks to separate each piece of information). I tried using "" but it displays the string literal.

Is there any way I could display each variable under the title of the graph with different fonts etc?

Tarang Hirani
  • 560
  • 1
  • 12
  • 43

1 Answers1

0

If you are looking for series title customization, it can be customized with tooltipFormat event.
[Use some separator(I use ; as a separator) and format with html, css]

In below statement, I changed separator to ;

text: chartTypeText + ': ' + chartTitle + ";" + $('#baselineResidentialLocationCity option:selected').text() + ', ' + $("#baselineResidentialLocationState option:selected").val() + ';' + $('#baselineResidentialStandardYear option:selected').text() + ' ' + baselinePeriod + ' year'

<script lang="javascript" type="text/javascript">
    $(function () {
        $('#ChartClientID').bind('tooltipFormat', function (e, data) {
            var t=data.series.title.split(";");

            //OR here you can dynamically build here it self

            return "<b>" + t[0] + "</b><br />" 
                   + (t[1] || "") + "<br />" 
                   + (t[2] || "");
        });
    });
</script>

see this link for reference: http://www.jqchart.com/aspnet/chart/ChartFeatures/Tooltips

Koti Panga
  • 3,660
  • 2
  • 18
  • 21