Link to home
Start Free TrialLog in
Avatar of altariamx2003
altariamx2003Flag for Mexico

asked on

how to move the Y-scale inside a chart with "echarts"

I would like to know if somebody know how to move the labels of the y-axis inside the chart using the libraries "echarts"

this is the code that im trying
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="ECharts">
    <meta name="author" content="kener.linfeng@gmail.com">
    <title>ECharts · Example</title>


    <script src="./www/js/echarts.js"></script></script>

</head>


<body>

    <div id="main" style="height:400px"></div>


    <script type="text/javascript">

        require.config({
            paths: {
                echarts: '../../build/dist/'
				
				
            }
        });
        require(
            [
            'echarts',
            'echarts/chart/bar',
            'echarts/chart/line'
            ],
            function (ec) {
                var myChart = ec.init(document.getElementById('main')); 
                
                var option = {

    tooltip : {
        trigger: 'axis'
    },
    legend: {
        data:['Serie 1','Serie 2','Serie 3']
    },
    toolbox: {
        show : true,
        feature : {
            magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
            restore : {show: true},
            saveAsImage : {show: true}
        }
    },
    calculable : true,
    xAxis : [
        {
            type : 'category',
            boundaryGap: false,
            data : ['Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio']
        }
    ],
    yAxis : [
        {
            type : 'value'
        }
    ],
    series : [
        {
            name:'Serie 1',
            type:'line',
            smooth:true,
            itemStyle: {normal: {areaStyle: {type: 'default'}}},
            data:[1320, 1132, 601, 234, 120, 90, 20]
        }        ,
        {
            name:'Serie 2',
            type:'line',
            smooth:true,
            itemStyle: {normal: {areaStyle: {type: 'default'}}},
            data:[30, 182, 434, 791, 390, 30, 10]
        },{
            name:'Serie 3',
            type:'line',
            smooth:true,
            itemStyle: {normal: {areaStyle: {type: 'default'}}},
            data:[10, 12, 21, 54, 260, 830, 710]
        }

    ]
};

                myChart.setOption(option); 
            }
        );
    </script>
</body>
</html>

Open in new window


and this is a screen of the chart: User generated image.

I would like to know if somebody know how to move the labels of the y-axis to  inside the chart using the libraries "echarts"
ASKER CERTIFIED SOLUTION
Avatar of altariamx2003
altariamx2003
Flag of Mexico image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of altariamx2003

ASKER

I found the solution by myself