2
I am trying to make an effect, when I choose an option in select, I show the corresponding div with highchart
.
Has 2 problems:
1- Width of Chart is not correctly completing width of div.
2- I’m not able to think of a way to hide the other options when one is shown. (will be more than 3 options, in the example have two not to complicate too much).
HTML
<div style="width:80%;">
<select class="selectchart" id="selectsolicitacoes"><option>Por mês</option><option value="#hg3">Por semana</option><option value="#hg2">Por dia</option></select><br>
<div id="hg2" style="min-width: 310px; height: 400px; margin: 0 auto; display: none;"> </div>
<div id="hg3" style="min-width: 310px; height: 400px; margin: 0 auto; display: none;"> </div>
Javascript
$(document).ready(function(){
$('#selectsolicitacoes').change(function(){
var element = $(this).val();
$(element).show();
});
});
Igor, is this what you’re looking for? http://jsfiddle.net/6S9cZ/1/
– Sergio
Hello. Solved the second problem, the first one is not yet. The Chart is not appearing occupying the whole
div
only half of it– Igor Martins