I'm trying to make an effect of when I choose an option in the select, I show the corresponding div with highchart
.
You have 2 problems:
1- The width of the chart is not completing the width of the div correctly.
2- I can not think of a way to hide the other options when one is shown. (there will be more than 3 options, in the example there are two to not complicate 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();
});
});