JavaScript Draw a Line Chart with both solid and dotted line in it with angular nvd3js directive? draw line chart in excel,draw line chart online,draw

I'm using angular-nvd3 directive for making a custom line chart display counting number of guest in specific period time range as follow :

  1. current Time - 2 --> current Time : will be display as straight line
  2. current Time --> current Time + 2 : will be display as dotted line .

Here is my implementation code with only straight line:

var app = angular.module('plunker', ['nvd3']);

app.controller('MainCtrl', function($scope) {
  $scope.options = {
            chart: {
                type: 'lineChart',
                tooltips: false,
                height: 450,
                margin : {
                    top: 20,
                    right: 20,
                    bottom: 40,
                    left: 55
                },
                x: function(d){ return d.x; },
                y: function(d){ return d.y; },
                useInteractiveGuideline: false,
                dispatch: {
                    stateChange: function(e){ console.log("stateChange"); },
                    changeState: function(e){ console.log("changeState"); },
                    tooltipShow: function(e){ console.log("tooltipShow"); },
                    tooltipHide: function(e){ console.log("tooltipHide"); }
                },
                xAxis: {
                    axisLabel: 'Time (ms)'
                },
                yAxis: {
                    axisLabel: 'Voltage (v)',
                    tickFormat: function(d){
                        return d3.format('.02f')(d);
                    },
                    axisLabelDistance: 30
                },
                callback: function(chart){
                    console.log("!!! lineChart callback !!!");
                }
            },
            title: {
                enable: true,
                text: 'Title for Line Chart'
            }
            
        };

        $scope.data = sinAndCos();

        /*Random Data Generator */
        function sinAndCos() {
            var sin = [],sin2 = [],
                cos = [];

            //Data is represented as an array of {x,y} pairs.
            for (var i = 0; i < 100; i++) {
                sin.push({x: i, y: Math.sin(i/10)});
                sin2.push({x: i, y: i % 10 == 5 ? null : Math.sin(i/10) *0.25 + 0.5});
                cos.push({x: i, y: .5 * Math.cos(i/10+ 2) + Math.random() / 10});
            }

            //Line chart data should be sent as an array of series objects.
            return [
                {
                    values: [{x:7,y:100},{x:8,y:40},{x:9,y:70}],      
                    key: 'Sine Wave', //key  - the name of the series.
                    color: '#ff7f0e',  //color - optional: choose your own line color.
                    strokeWidth: 2    
                },
                {
                
                    values: [{x:7,y:200},{x:8,y:140},{x:9,y:170},{x:10,y:120},{x:11,y:180}],
                    key: 'Cosine Wave',
                    color: '#2ca02c'
                },
                {
                    values: [{x:7,y:300},{x:8,y:240},{x:9,y:270},{x:10,y:220},{x:11,y:280}],
                    key: 'Another sine wave',
                    color: '#7777ff'    
                }
            ];
        };
});
Answer:1

how to make setTimeout() work as it looks like in for-loop? like this code function hello() { for (let index = 0; index < 3; index++) { setTimeout(function () { console....

how to make setTimeout() work as it looks like in for-loop? like this code function hello() { for (let index = 0; index < 3; index++) { setTimeout(function () { console....

Promise.prototype.finally has been part of the ECMAScript specification for more than a year and gives no errors in most browsers. When used within Teams desktop app, I see "Promise.prototype....

Promise.prototype.finally has been part of the ECMAScript specification for more than a year and gives no errors in most browsers. When used within Teams desktop app, I see "Promise.prototype....

I'd like my countdown timer to show double digits, like "53:00" instead of "53:0". Not sure what's going wrong here? Thank you! function convertSeconds(s) { var min = Math.floor(s / 60); var ...

I'd like my countdown timer to show double digits, like "53:00" instead of "53:0". Not sure what's going wrong here? Thank you! function convertSeconds(s) { var min = Math.floor(s / 60); var ...

  1. numberformat javascript locale
  2. number format javascript money
  3. number format javascript 2 decimal places
  4. number format javascript commas
  5. number format javascript decimal
  6. number format javascript currency
  7. number format javascript library
  8. number format javascript jquery
  9. number format javascript leading zero
  10. number format javascript php
  11. number format javascript example
  12. number format javascript function
  13. number format javascript input
  14. number format javascript regex
  15. number format javascript decimal places
  16. number_format javascript like php
  17. number format javascript pdf
  18. javascript numberformat comma
  19. javascript numberformat currency
  20. javascript numberformat style

I'm trying to create an admin template with a sidebar that can be toggled. I want it to just slide in and out and the content resize accordingly. I've tried everything I can think of and nothing works....

I'm trying to create an admin template with a sidebar that can be toggled. I want it to just slide in and out and the content resize accordingly. I've tried everything I can think of and nothing works....

  1. semantic ui collapsible sidebar