Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7705291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:49:56+00:00 2026-05-31T23:49:56+00:00

I want to display a straight line graph using AMChart. But it does not

  • 0

I want to display a straight line graph using AMChart. But it does not draw line between points if their y values are equal. How can I solve this problem.

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>amCharts examples</title>
    <link rel="stylesheet" href="style.css" type="text/css">
    <script src="../amcharts/amcharts.js" type="text/javascript"></script>          
    <script type="text/javascript">
        var chart;
        var graph;

        // months in JS are zero-based, 0 means January 
        var chartData = [{
            year: new Date(1950, 0),
            value: 300
        }, {
            year: new Date(1951, 0),
            value: 300
        }, {
            year: new Date(1952, 0),
            value: 300
        }, {
            year: new Date(1953, 0),
            value: 300
        }];


        AmCharts.ready(function () {
            // SERIAL CHART
            chart = new AmCharts.AmSerialChart();
            chart.pathToImages = "../amcharts/images/";
            chart.dataProvider = chartData;
            chart.marginLeft = 10;
            chart.categoryField = "year";
            chart.zoomOutButton = {
                backgroundColor: '#000000',
                backgroundAlpha: 0.15
            };

            // listen for "dataUpdated" event (fired when chart is inited) and call zoomChart method when it happens
            chart.addListener("dataUpdated", zoomChart);

            // AXES
            // category
            var categoryAxis = chart.categoryAxis;
            categoryAxis.parseDates = true; // as our data is date-based, we set parseDates to true
            categoryAxis.minPeriod = "YYYY"; // our data is yearly, so we set minPeriod to YYYY
            categoryAxis.gridAlpha = 0;

            // value
            var valueAxis = new AmCharts.ValueAxis();
            valueAxis.axisAlpha = 0;
            valueAxis.inside = true;
            chart.addValueAxis(valueAxis);

            // GRAPH                
            graph = new AmCharts.AmGraph();
            graph.type = "smoothedLine"; // this line makes the graph smoothed line.
            graph.lineColor = "#d1655d";
            graph.negativeLineColor = "#637bb6"; // this line makes the graph to change color when it drops below 0
            graph.bullet = "round";
            graph.bulletSize = 5;
            graph.lineThickness = 2;
            graph.valueField = "value";
            chart.addGraph(graph);

            // CURSOR
            var chartCursor = new AmCharts.ChartCursor();
            chartCursor.cursorAlpha = 0;
            chartCursor.cursorPosition = "mouse";
            chartCursor.categoryBalloonDateFormat = "YYYY";
            chart.addChartCursor(chartCursor);

            // SCROLLBAR
            var chartScrollbar = new AmCharts.ChartScrollbar();
            chartScrollbar.graph = graph;
            chartScrollbar.backgroundColor = "#DDDDDD";
            chartScrollbar.scrollbarHeight = 30;
            chartScrollbar.selectedBackgroundColor = "#FFFFFF";
            chart.addChartScrollbar(chartScrollbar);

            // WRITE
            chart.write("chartdiv");
        });

        // this method is called when chart is first inited as we listen for "dataUpdated" event
        function zoomChart() {
            // different zoom methods can be used - zoomToIndexes, zoomToDates, zoomToCategoryValues
            chart.zoomToDates(new Date(1949, 0), new Date(1955, 0));
        }
    </script>
</head>

<body>
    <div id="chartdiv" style="width:100%; height:400px;"></div>
</body>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T23:49:56+00:00Added an answer on May 31, 2026 at 11:49 pm

    Are you by any luck using google chrome ? If yes, I had the same problem, and it seems to be a bug in Google chrome itself, which prevents drawing colinear polylines, such as you described in your question…

    Here is a link to the bug report, which you can probably star to follow…
    http://code.google.com/p/chromium/issues/detail?id=60306

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to display tabular type data, but it will not be coming from
This should be fairly straight forward but is proving not to be. I want
i want to display some information in a listview using the GridView. i have
I want to display the infinity symbol using CGContextSelectFont(context, HelveticaNeue, textSize, kCGEncodingMacRoman); CGContextShowTextAtPoint(context, myCenter.x,
It seems pretty straight forward to get what I want. The data details display
I want to display Arabic on my site.... quite straight forward so far :)
I have a simple quiz application and I want display a nice timer /
I want to display the TIME field from my mysql table on my website,
I want to display dates in the format: short day of week, short month,
I want to display the current host and database names in a view. Where

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.