test problem

69 views
Skip to first unread message

Bilbon Sakket

unread,
Mar 28, 2020, 3:43:30 PM3/28/20
to Google Visualization API
test

Bilbon Sakket

unread,
Mar 28, 2020, 3:43:58 PM3/28/20
to Google Visualization API
{"cols":[{"id":0,"label":"timestamp","type":"string"},{"id":0,"label":"low","type":"number"},{"id":0,"label":"open","type":"number"},{"id":0,"label":"close","type":"number"},{"id":0,"label":"high","type":"number"},{"id":1,"label":"volumeSell","type":"number"},{"id":2,"label":"volumeBuy","type":"number"},{"id":3,"label":"last","type":"number"}],"rows":[{"c":[{"v":"18:52:39"},{"v":6196.5},{"v":6198},{"v":6196.5},{"v":6202.5},{"v":351277},{"v":502971},{"v":6227}]},{"c":[{"v":"18:53:9"},{"v":6190},{"v":6196.5},{"v":6190},{"v":6197},{"v":713822},{"v":40791},{"v":6227}]},{"c":[{"v":"18:53:39"},{"v":6177.5},{"v":6190},{"v":6177.5},{"v":6190.5},{"v":2572264},{"v":727838},{"v":6227}]},{"c":[{"v":"18:54:8"},{"v":6165},{"v":6177.5},{"v":6172.5},{"v":6177.5},{"v":2855750},{"v":814882},{"v":6227}]},{"c":[{"v":"18:54:38"},{"v":6172.5},{"v":6172.5},{"v":6182},{"v":6182},{"v":248279},{"v":714047},{"v":6227}]},{"c":[{"v":"18:55:8"},{"v":6168.5},{"v":6182},{"v":6169},{"v":6182},{"v":1276829},{"v":151744},{"v":6227}]},{"c":[{"v":"18:55:39"},{"v":6165.5},{"v":6169},{"v":6170},{"v":6175},{"v":1183547},{"v":302659},{"v":6227}]},{"c":[{"v":"18:56:9"},{"v":6166},{"v":6170},{"v":6166},{"v":6170},{"v":203377},{"v":14167},{"v":6227}]},{"c":[{"v":"18:56:39"},{"v":6154.5},{"v":6166},{"v":6166},{"v":6166.5},{"v":1726056},{"v":400338},{"v":6227}]},{"c":[{"v":"18:57:9"},{"v":6165},{"v":6166},{"v":6167},{"v":6167},{"v":320289},{"v":485708},{"v":6227}]},{"c":[{"v":"18:57:39"},{"v":6167},{"v":6167},{"v":6173.5},{"v":6174.5},{"v":150867},{"v":377108},{"v":6227}]},{"c":[{"v":"18:58:8"},{"v":6173.5},{"v":6173.5},{"v":6175},{"v":6175},{"v":19499},{"v":250862},{"v":6227}]},{"c":[{"v":"18:58:39"},{"v":6172},{"v":6175},{"v":6172.5},{"v":6175},{"v":524813},{"v":264753},{"v":6227}]},{"c":[{"v":"18:59:9"},{"v":6172},{"v":6172.5},{"v":6183.5},{"v":6183.5},{"v":12747},{"v":1415250},{"v":6227}]},{"c":[{"v":"18:59:38"},{"v":6182.5},{"v":6183.5},{"v":6182.5},{"v":6183.5},{"v":817728},{"v":128263},{"v":6227}]},{"c":[{"v":"19:0:8"},{"v":6179.5},{"v":6182.5},{"v":6185.5},{"v":6185.5},{"v":360056},{"v":427051},{"v":6227}]},{"c":[{"v":"19:0:39"},{"v":6185},{"v":6185.5},{"v":6200},{"v":6202.5},{"v":287476},{"v":2505587},{"v":6227}]},{"c":[{"v":"19:1:8"},{"v":6198},{"v":6200},{"v":6198.5},{"v":6200.5},{"v":546594},{"v":161073},{"v":6227}]},{"c":[{"v":"19:1:39"},{"v":6198},{"v":6198.5},{"v":6210},{"v":6210},{"v":204794},{"v":2748532},{"v":6227}]},{"c":[{"v":"19:2:8"},{"v":6205.5},{"v":6210},{"v":6206},{"v":6212.5},{"v":689541},{"v":432109},{"v":6227}]},{"c":[{"v":"19:2:38"},{"v":6195.5},{"v":6206},{"v":6195.5},{"v":6206},{"v":877105},{"v":87367},{"v":6227}]},{"c":[{"v":"19:3:7"},{"v":6195.5},{"v":6195.5},{"v":6195.5},{"v":6196},{"v":45738},{"v":28084},{"v":6227}]},{"c":[{"v":"19:3:39"},{"v":6195.5},{"v":6195.5},{"v":6200},{"v":6200},{"v":12054},{"v":409558},{"v":6227}]},{"c":[{"v":"19:4:8"},{"v":6197.5},{"v":6200},{"v":6197.5},{"v":6207.5},{"v":305188},{"v":763852},{"v":6227}]},{"c":[{"v":"19:4:38"},{"v":6197.5},{"v":6197.5},{"v":6198},{"v":6198.5},{"v":8504},{"v":254073},{"v":6227}]},{"c":[{"v":"19:5:9"},{"v":6198},{"v":6198},{"v":6205},{"v":6205},{"v":15245},{"v":515688},{"v":6227}]},{"c":[{"v":"19:5:38"},{"v":6198},{"v":6205},{"v":6198.5},{"v":6205},{"v":358407},{"v":93558},{"v":6227}]},{"c":[{"v":"19:6:9"},{"v":6198},{"v":6198.5},{"v":6198},{"v":6198.5},{"v":18580},{"v":76999},{"v":6227}]},{"c":[{"v":"19:6:38"},{"v":6197.5},{"v":6198},{"v":6197.5},{"v":6198.5},{"v":252394},{"v":2088},{"v":6227}]},{"c":[{"v":"19:7:9"},{"v":6197.5},{"v":6197.5},{"v":6197.5},{"v":6198},{"v":58924},{"v":6777},{"v":6227}]},{"c":[{"v":"19:7:38"},{"v":6197.5},{"v":6197.5},{"v":6197.5},{"v":6198},{"v":24476},{"v":21032},{"v":6227}]},{"c":[{"v":"19:8:9"},{"v":6196.5},{"v":6197.5},{"v":6196.5},{"v":6198},{"v":146980},{"v":22056},{"v":6227}]},{"c":[{"v":"19:8:38"},{"v":6195},{"v":6196.5},{"v":6195},{"v":6196.5},{"v":170029},{"v":402},{"v":6227}]},{"c":[{"v":"19:9:8"},{"v":6186},{"v":6195},{"v":6186.5},{"v":6195.5},{"v":815473},{"v":64133},{"v":6227}]},{"c":[{"v":"19:9:39"},{"v":6186.5},{"v":6186.5},{"v":6200},{"v":6200},{"v":37081},{"v":692276},{"v":6227}]},{"c":[{"v":"19:10:9"},{"v":6199.5},{"v":6200},{"v":6218.5},{"v":6227.5},{"v":477495},{"v":4334707},{"v":6227}]},{"c":[{"v":"19:10:39"},{"v":6217},{"v":6218.5},{"v":6234.5},{"v":6240},{"v":744275},{"v":4866379},{"v":6227}]},{"c":[{"v":"19:11:8"},{"v":6225.5},{"v":6234.5},{"v":6230},{"v":6234.5},{"v":199628},{"v":931923},{"v":6227}]},{"c":[{"v":"19:11:39"},{"v":6229},{"v":6230},{"v":6229.5},{"v":6230.5},{"v":316081},{"v":39386},{"v":6227}]},{"c":[{"v":"19:12:9"},{"v":6227.5},{"v":6229.5},{"v":6227.5},{"v":6229.5},{"v":319199},{"v":36280},{"v":6227}]},{"c":[{"v":"19:12:39"},{"v":6221},{"v":6227.5},{"v":6221},{"v":6228},{"v":696306},{"v":13869},{"v":6227}]},{"c":[{"v":"19:13:8"},{"v":6220},{"v":6221},{"v":6223},{"v":6223},{"v":22692},{"v":252897},{"v":6227}]},{"c":[{"v":"19:13:38"},{"v":6218},{"v":6223},{"v":6218},{"v":6223},{"v":256454},{"v":8215},{"v":6227}]},{"c":[{"v":"19:14:4"},{"v":6218},{"v":6218},{"v":6225},{"v":6225},{"v":64403},{"v":554983},{"v":6227}]},{"c":[{"v":"19:14:35"},{"v":6224.5},{"v":6225},{"v":6224.5},{"v":6225},{"v":14770},{"v":6006},{"v":6227}]},{"c":[{"v":"19:15:7"},{"v":6223},{"v":6224.5},{"v":6223},{"v":6225},{"v":282314},{"v":11174},{"v":6227}]},{"c":[{"v":"19:15:38"},{"v":6223},{"v":6223},{"v":6223},{"v":6223.5},{"v":27297},{"v":307442},{"v":6227}]},{"c":[{"v":"19:16:8"},{"v":6223},{"v":6223},{"v":6227.5},{"v":6227.5},{"v":2674},{"v":497450},{"v":6227}]},{"c":[{"v":"19:16:39"},{"v":6225},{"v":6227.5},{"v":6225.5},{"v":6227.5},{"v":122597},{"v":21994},{"v":6227}]},{"c":[{"v":"19:17:8"},{"v":6223},{"v":6225.5},{"v":6227},{"v":6227.5},{"v":125956},{"v":125274},{"v":6227}]},{"c":[{"v":"19:17:31"},{"v":6227},{"v":6227},{"v":6227},{"v":6227.5},{"v":9444},{"v":2004},{"v":6227}]}]}
Enter code here...

json data^

On Saturday, 28 March 2020 15:43:30 UTC-4, Bilbon Sakket wrote:
test
Message has been deleted

Bilbon Sakket

unread,
Mar 28, 2020, 3:44:47 PM3/28/20
to Google Visualization API
broken Y axis 1 when isStacked: true

Bilbon Sakket

unread,
Mar 28, 2020, 3:45:16 PM3/28/20
to Google Visualization API

correctly display candlestick Y axis 1 min/max value when isStacked: false

Bilbon Sakket

unread,
Mar 28, 2020, 3:46:49 PM3/28/20
to Google Visualization API
Since I created a second bars chart to display volumeSells and volumeBuys stacked on top each other (Before was only using 1 bar chart with volumeAll instead) the Y axis 1: min/max value is broken
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Bilbon Sakket

unread,
Mar 28, 2020, 4:01:51 PM3/28/20
to Google Visualization API
<script type="text/javascript">
        google.charts.load('current', { packages: ['corechart'] });
        google.charts.setOnLoadCallback(drawChart);
        function drawChart() {
            var jsonData = $.ajax({
                url: "getdata.php",
                dataType: "json",
                async: false
            }).responseText;
            var data = new google.visualization.DataTable(jsonData, true);
            var options = {
                title: 'BITMEX:XBTUSD',
                vAxis: { title: '100%', showTextEvery: 1 },
                hAxis: { title: '100%', showTextEvery: 5 },
                axisTitlesPosition: 'none',
                legend: 'none',
                backgroundColor: '#FFFFFF',
                chartArea: { left: '5%', top: '3%', width: '90%', height: '94%' },
                width: '100%',
                height: '100%',
                lineWidth: 1,
                bar: { groupWidth: '95%' },
                isStacked: true,
                candlestick: {
                    fallingColor: { stroke: '#000000', strokeWidth: 1, fill: '#a52714' },
                    risingColor: { stroke: '#000000', strokeWidth: 1, fill: '#0f9d58' }
                },
                seriesType: 'candlesticks',
                series: {
                    0: { type: 'candlesticks', targetAxisIndex: 1 },
                    1: { type: 'bars', color: '#1C1C1C', areaOpacity: 0.7, targetAxisIndex: 0, labelInLegend: false, visibleInLegend: false },
                    2: { type: 'bars', color: '#6E6E6E', areaOpacity: 0.7, targetAxisIndex: 0, labelInLegend: false, visibleInLegend: false },
                    3: { type: 'line', color: '#FF8000', targetAxisIndex: 1 }
                },
                vAxes: {
                    0: { format: 'short' },
                }
            };
            var chart = new google.visualization.ComboChart(document.getElementById('chart_div'));
            chart.draw(data, options);
            setTimeout(function () { drawChart() }, 5000);
        }
    </script>

Bilbon Sakket

unread,
Mar 28, 2020, 5:22:20 PM3/28/20
to Google Visualization API
Problem:
-without isStacked:
If I don't use isStacked: true, the two bars chart in my candlesticks, bar, bar, line combochart display the two bars chart side by side AND the y axis 1 (right) display correctly by default with min/max values.
-with isStacked: true,
If I add isStacked: true, the two bars chart stack on top each other, but the y axis 1 (right) min value becomes 0 and my candlesticks display super small and dont understand why it behave this way.
  Do I have to specify the min value somewhere? when it should just behave like previously? or isStacked add complexity?

Bilbon Sakket

unread,
Mar 30, 2020, 4:34:10 PM3/30/20
to Google Visualization API
after much digging,

looks like:

-ComboChart doesn't support stacking two bar series without destroying the Y axis ruler.
-Bar chart doesn't support stacking vertically
-two other bar chart also doesnt support stacking vertically
-steppedchart does support stacking but it isn't the same as I want

so collumnBar was the way to go and support stacking vertically.

had to make two charts but at least now I can see the data as I wish.

Bilbon Sakket

unread,
Mar 30, 2020, 4:34:32 PM3/30/20
to Google Visualization API
SOLVED.
Reply all
Reply to author
Forward
0 new messages