casillas
casillas

Reputation: 16803

Move button inside the chart

I have the following project which I display signals on the chart. And recently I have implemented pdf export. However I want this button to be on the top or below the legends. I could not able to figure that out.

<div id="chart"></div>
<button class='export-pdf k-button'>Save as PDF</button>

Upvotes: 2

Views: 106

Answers (2)

shadab
shadab

Reputation: 347

Try this code.

.k-button {
    float: right;
    margin-top: -45px;
    position: relative;
}

Upvotes: 1

iamjpg
iamjpg

Reputation: 7628

I created a slightly different solution to the one provided. I wrapped your chart div in a relatively positioned div:

#chart-container { position: relative; }

Then I give the button absolute positioning so it will always be absolutely positioned relatively to the wrapping container (and not the window).

Here is a JSFiddle: http://jsfiddle.net/iamjpg/beg04nwf/

Good luck!

Upvotes: 2

Related Questions