Home › forums › Using CanvasJS › custom annotation with highlight time range
This topic contains 5 replies, has 3 voices, and was last updated by Bivek Singh 2 years, 2 months ago.
I have two questions about using canvajs.
1. I know using startValue and endValue to define stripline width. But is it possible to define stripline height as well if stripline options are set to axisX?
2. Is it possible to draw a flag on a specific position right above axis, just like an annotation?
1. Defining the stripLine height is not possible as of now.
2. For something like annotations you can position either image on the chart as in this example or add a scatter or bubble dataSeries as a work-around.
Thank you for the response.
The work-around does not meet my needs. Any ways to draw a customized flag on a defined position of the line chart?
Sorry, we are unable to understand your requirements properly. Can you please clarify what do you mean by a customized flag? Is it an image or you want to draw flags on the chart yourself? Also it would be helpful if you can provide us with some pictorial representation.
Let’s use your example:http://jsfiddle.net/canvasjs/u50cqf09/
My question is the following:
1. Is it possible to place the chrome icon in an arbitary position? for example, (35,20).
2. Instead of chrome icon, can we draw a square and place a number in it? Just like draw on a canvas?
Yes, you can place an image at any position you like. You just need to provide the pixel co-ordinates position to the top and left CSS properties of image. You can also make use of convertPixelToValue and convertValueToPixel methods provided in the library.
For your second query, You can draw anything you like on the canvas. Please take a look at this jsFiddle.
You must be logged in to reply to this topic.