Closed zoaeu12 closed 7 years ago
Hi,
In current version, it is not possible, however, it is possible to draw a border around the title. see https://github.com/FVANCOP/ChartNew.js/wiki/100_130_Border_and_Background_Color-for-text.
I think that I will add an option to specify which lines of the border has to be drawn. This will make possible to underline a text zone... Probably available at the end of augustus.
i added Underline Options(width, color, padding ...) and used 'setTextBordersAndBackground' function code is :
if(Underline){
if (optiongroup == "GRAPHTITLE") {
ctx.save();
ctx.lineWidth = UnderlineWidth;
ctx.strokeStyle = UnderlineColor;
var textWidth = ctx.measureText(text).width;
ctx.moveTo(0 - (textWidth / 2) + UnderlinePaddingX, UnderlinePaddingY);
ctx.lineTo(textWidth - (textWidth / 2) + UnderlinePaddingX, UnderlinePaddingY);
ctx.stroke();
ctx.restore();
}
}
it work. thank you
In the last version, new options have been added. To underline the title, set option graphTitleBordersSelection to 1.
See : https://github.com/FVANCOP/ChartNew.js/wiki/100_130_Border_and_Background_Color-for-text
thanks for your awesome library. how can i make underline graphTitle?