mardi 1 août 2017

Amchart x-axis values are changing not moving/shifting

I have a problem with my x-axis values, since I'm using real time amchart my x-axis values are changing every 3 seconds but the problem is that they're changing not moving, let's say I have (Aug 3) instead of it moving to the left the value changes to the next one! I want it so slide like this one: http://ift.tt/2f6Tmt2

Mine looks like this: http://ift.tt/2hmew7g

If you can notice if there's (Aug 3) the value doesn't move or keeps moving to the end of the chart it changes to the next value, as my problem!

And this is my code if it helps:

  methods:{
    initChart(dataProvieded){
        chart = AmCharts.makeChart("chart"+num, {
              "type": "serial",
              "theme": "light",
              "synchronizeGrid":true,
              "marginTop":0,
              "marginRight": 80,
               "autoMarginOffset":90,
               "dataDateFormat": "YYYY-MM-DD",
              "dataProvider": dataProvieded,
              "zoomOutButton": {
                "backgroundColor": '#000000',
                "backgroundAlpha": 0.15
              },

              "valueAxes": [{ 
                  "axisAlpha": 1,
                  "position": "left",
              //   "autoWrap" : false,
                "minorGridEnabled": true,
                "autoGridCount": false,
                 "gridCount": 3,
             //    "min" : 5 ,
              //   "max" : 2,
            //     "strictMinMax": true,


              }],
              "graphs": [
                {  "id":"g1",
     "balloonText": "<img src='javascripts/images/info.png' style='vertical-align:bottom; margin-right: 5px; width:28px; height:21px;'><span style='font-size:10px; color:#000000;'><b>[[value]]</b></span><img src='javascripts/images/time.png' style='vertical-align:bottom; margin-right: 5px; width:28px; height:21px;'><span style='font-size:10px; color:#000000;'><b>[[category]]</b></span>",

                  "bullet": "round",
                  "bulletSize": 6,
                  "lineColor": "#003366",
                  "lineThickness": 1.5,
                  "negativeLineColor": "#637bb6",
                  "type": "smoothedLine",
                 "valueField": "value" },

              {
                  "id":"g2",
             "balloonText": "<img src='javascripts/images/info.png' style='vertical-align:bottom; margin-right: 5px; width:28px; height:21px;'><span style='font-size:10px; color:#000000;'><b>[[value]]</b></span><img src='javascripts/images/time.png' style='vertical-align:bottom; margin-right: 5px; width:28px; height:21px;'><span style='font-size:10px; color:#000000;'><b>[[category]]"+ new Date().toJSON().slice(0,10).replace(/-/g,'/') +"</b></span>",

                  "bullet": "round",
                  "bulletSize": 6,
                  "lineColor": "#00c78c",
                  "lineThickness": 1.5,
                  "negativeLineColor": "#637bb6",
                  "type": "smoothedLine",
                   "valueField": "value2"

              },
              {
                  "id":"g3",

               "balloonText": "<img src='javascripts/images/info.png' style='vertical-align:bottom; margin-right: 5px; width:28px; height:21px;'><span style='font-size:10px; color:#000000;'><b>[[value]]</b></span><img src='javascripts/images/time.png' style='vertical-align:bottom; margin-right: 5px; width:28px; height:21px;'><span style='font-size:10px; color:#000000;'><b>[[category]]</b></span>",

                  "bullet": "round",
                  "bulletSize": 6,
                  "lineColor": "#f23452",
                  "lineThickness": 1.5,
                  "negativeLineColor": "#637bb6",
                  "type": "smoothedLine",
                   "valueField": "value3",

              }],

              "chartScrollbar": {
                  "graph":"g1",
                  "gridAlpha":0,
                  "color":"#888888",
                  "scrollbarHeight":55,
                  "backgroundAlpha":0,
                  "selectedBackgroundAlpha":0.1,
                  "selectedBackgroundColor":"#000000",
                  "graphFillAlpha":0,
                  "autoGridCount":true,
                  "selectedGraphFillAlpha":0,
                  "graphLineAlpha":0.2,
                  "graphLineColor":"#c2c2c2",
                  "selectedGraphLineColor":"#888888",
                  "selectedGraphLineAlpha":1,
                  "autoGridCount": false,
                   "gridCount": 5,

              },
              "categoryField": "date",
              "categoryAxis": {
                 "minorGridEnabled": true,
                 "autoGridCount": false,
                 "gridCount": 5,
                 "dashLength" : 5,
              }


          }) 


           console.log ('zero');
                setInterval(function(){
                 console.log ('one');
                axios.get('/feeder/1/1').then(function(response){
                console.log ('two');
                    chart.dataProvider.shift();
                    var date0 = new Date(response.data[7]);
                    var hours = date0.getHours();
                    var minutes = "0" + date0.getMinutes();
                    var seconds = "0" + date0.getSeconds();
                    var formattedTime = hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2);
                    console.log(formattedTime);
                    chart.dataProvider.push( {
                        date: formattedTime,
                        value: response.data[0] / 1000,
                        value2: response.data[1] / 1000,
                        value3: response.data[2] / 1000
                    } );
                    chart.validateData();
                    }); } , 3000);


        },

Thank you.




Crawling a webpack based application with scrapy?

Is that possible to crawl a web application bundled with webpack (with DOM content is in bundle.js)?




How to detect Voice-over in a web application

Need to build a web application to load different html based on whether the Voice-over is turned on or not.

Did some search online. But did not find anything useful. Want to know if native JavaScript is able to do that or any framework that I can call?




Things to consider before launching a BIG website?

I’m about to launch a classifieds website like gumtree and OLX in South Africa…., but it’s not gonna be as big as Gumtree or OLX obviously. It’s going to operate in one province…planning to expand it over time.

The site works like a charm on my local machine, but I’m concerned coz I’ve never launched a big website before. Plus, I just graduated from University this year – no work experience. But I’m positive that if Facebook and Twitter were built by students, I too can build my own thing and run it successfully.

Are there any key issues to take into consideration before launching a big website ?




Define Web Developer Vs IT Support

Please can I ask for definitions of a Web Developer and a definition of someone that works as IT support. Please could you also explain how the career avanues might differ and if they are similar in any way?

Many thanks in advance.




common error and challenging indeed, php issue(at header location )

just look at the header location problem, it is showing an error of cannot modify header information, header already sent.

enter image description here




Google App Maker Alternatives: free, simple, beginner-friendly, secure

I need to build a secure commercial web application that guides users through steps (like, 1, create your account and login 2, select subscription type, 3, redirect to payment page, 4, other). Some of these steps involve making backend HTTP GET/PUT/POST requests based on the user inputted information (so perhaps Wordpress, Wix, Weebly, Squarespace, and some others may be ruled out). I could also use PythonAnywhere or Google Cloud App Engine but it requires much more configuration. I have also tried MS Azure which had a perfect one-click enable login setting but it was expensive. I have also not given Zoho Creator a try since it is not free.

I noticed that Google App Maker was released in beta for GSuite users, which is excellent because it is Google, is secure, free, and allows for super simple web development. But since it is still in Beta they have blocked off sharing web apps outside of your own organization. I looked around and I found Firebase (requires some coding to implement the login, no WYSIWYG editor) and Google Apps Script (does not have a WYSIWYG editor and shows yellow bar at the top, but login is automatic), which I will end up using unless you can provide any great alternative.

Am I missing any affordable/free, simple, beginner-friendly, secure web development platforms?