question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Size: (width and height)

See original GitHub issue

How do I set the width of the chart?

<chart width="150" type="StockChart" [options]="chartOptions" (load)="load" ></chart>

this doesn’t work

chartOptions = {
            width: 150,
...
}

doesn’t work either

the only thing that changes the width from default’s 600 is setting it directly to the component (or via the style or class)

if I do

<chart class="col-xs-2" type="StockChart" [options]="chartOptions" (load)="load" ></chart>

where col-xs-2 is a bootstrap’s class or

<chart style="width:150px" type="StockChart" [options]="chartOptions" (load)="load" ></chart>

then it works…

I would like to set the chart’s size (width/height) dynamically if possible, like so:

<chart [width]="chartWidth" type="StockChart" [options]="chartOptions" (load)="load" ></chart>

so that when chartWidth changes the chart is redrawn

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

18reactions
AbelValdezcommented, Jun 12, 2017

@shafaqkazmi try using a parent element with the size in this case is boostrap class

<div class="col-lg-5" style="border: solid 1px;">
<chart [options]="options" style="display:block; width: 100% !important;"></chart>
</div>
4reactions
Malaratgithubcommented, Jun 7, 2017

adding display: block to style, works for me. Thanks windmaomao

Read more comments on GitHub >

github_iconTop Results From Across the Web

Length, Width & Height | How to Read Dimensions - Smartick
Length, width, and height are measurements that allow us to indicate the volume of geometric bodies. The length (20 cm) and the width...
Read more >
Measurement: Length, width, height, depth - Elementary Math
When the figure is “level,” height clearly refers to the vertical dimension—how tall the figure is—regardless of whether that dimension is greatest or...
Read more >
What Comes First? Width or Height? - High Resolutions
The Graphics' industry standard is width by height (width x height). Meaning that when you write your measurements, you write them from your ......
Read more >
Length, Width, and Height | 1st Grade Math - Class Ace
You can use length, width, and height. Length: how long or short it is. Height: how tall or short it is. Width: how...
Read more >
How to Measure the Length x Width x Height of Shipping Boxes
1. Measure the longest side of the package. Start by identifying the longest side of the package, then hold a ruler or tape...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found