jQWidgets Forums

jQuery UI Widgets Forums Angular jqxChart drawBefore method

This topic contains 1 reply, has 2 voices, and was last updated by  Martin 6 years, 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • jqxChart drawBefore method #104235

    alexkor
    Participant

    is it possible to pass the value as html and not as plain text?
    i tried this :
    drawBefore = (renderer: any, rect: any): void => {
    let value;
    value = this.sanitized.bypassSecurityTrustHtml(‘<h1>test</h1>’);
    let sz = renderer.measureText(value, 0, { ‘class’: ‘chart-inner-text’ });
    renderer.text(
    value,
    rect.x + (rect.width – sz.width) / 2,
    rect.y + rect.height / 2,
    0,
    0,
    0,
    { ‘class’: ‘chart-inner-text’ }
    );

    }`
    but it returns as string

    jqxChart drawBefore method #104250

    Martin
    Participant

    Hello alexkor,

    No, the draw and drawBefore methods allows you to draw shapes and texts using SVG.
    You can pass plain text to renderer.text method and then use its class to add styles with css, for example setting font-size and font-weight in this case.

    Best Regards,
    Martin

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.