{
    "content": [
        {
            "type": "text",
            "text": "# Spreadsheet::WriteExcel::Chart::Line (perldoc)\n\n**Summary:** Line - A writer class for Excel Line charts.\n\n**Synopsis:** To create a simple Excel file with a Line chart using Spreadsheet::WriteExcel:\n#!/usr/bin/perl -w\nuse strict;\nuse Spreadsheet::WriteExcel;\nmy $workbook  = Spreadsheet::WriteExcel->new( 'chart.xls' );\nmy $worksheet = $workbook->addworksheet();\nmy $chart     = $workbook->addchart( type => 'line' );\n# Configure the chart.\n$chart->addseries(\ncategories => '=Sheet1!$A$2:$A$7',\nvalues     => '=Sheet1!$B$2:$B$7',\n);\n# Add the worksheet data the chart refers to.\nmy $data = [\n[ 'Category', 2, 3, 4, 5, 6, 7 ],\n[ 'Value',    1, 4, 5, 2, 1, 5 ],\n];\n$worksheet->write( 'A1', $data );\nEND\n\n## Examples\n\n- `Here is a complete example that demonstrates most of the available features when creating a`\n- `chart.`\n- `#!/usr/bin/perl -w`\n- `use strict;`\n- `use Spreadsheet::WriteExcel;`\n- `my $workbook  = Spreadsheet::WriteExcel->new( 'chartline.xls' );`\n- `my $worksheet = $workbook->addworksheet();`\n- `my $bold      = $workbook->addformat( bold => 1 );`\n- `# Add the worksheet data that the charts will refer to.`\n- `my $headings = [ 'Number', 'Sample 1', 'Sample 2' ];`\n- `my $data = [`\n- `[ 2, 3, 4, 5, 6, 7 ],`\n- `[ 1, 4, 5, 2, 1, 5 ],`\n- `[ 3, 6, 7, 5, 4, 3 ],`\n- `];`\n- `$worksheet->write( 'A1', $headings, $bold );`\n- `$worksheet->write( 'A2', $data );`\n- `# Create a new chart object. In this case an embedded chart.`\n- `my $chart = $workbook->addchart( type => 'line', embedded => 1 );`\n- `# Configure the first series. (Sample 1)`\n- `$chart->addseries(`\n- `name       => 'Sample 1',`\n- `categories => '=Sheet1!$A$2:$A$7',`\n- `values     => '=Sheet1!$B$2:$B$7',`\n- `);`\n- `# Configure the second series. (Sample 2)`\n- `$chart->addseries(`\n- `name       => 'Sample 2',`\n- `categories => '=Sheet1!$A$2:$A$7',`\n- `values     => '=Sheet1!$C$2:$C$7',`\n- `);`\n- `# Add a chart title and some axis labels.`\n- `$chart->settitle ( name => 'Results of sample analysis' );`\n- `$chart->setxaxis( name => 'Test number' );`\n- `$chart->setyaxis( name => 'Sample length (cm)' );`\n- `# Insert the chart into the worksheet (with an offset).`\n- `$worksheet->insertchart( 'D2', $chart, 25, 10 );`\n- `END`\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (28 lines)\n- **DESCRIPTION** (16 lines)\n- **Line Chart Methods** (3 lines)\n- **EXAMPLE** (50 lines)\n- **AUTHOR** (2 lines)\n- **COPYRIGHT** (5 lines)\n\n## Full Content\n\n### NAME\n\nLine - A writer class for Excel Line charts.\n\n### SYNOPSIS\n\nTo create a simple Excel file with a Line chart using Spreadsheet::WriteExcel:\n\n#!/usr/bin/perl -w\n\nuse strict;\nuse Spreadsheet::WriteExcel;\n\nmy $workbook  = Spreadsheet::WriteExcel->new( 'chart.xls' );\nmy $worksheet = $workbook->addworksheet();\n\nmy $chart     = $workbook->addchart( type => 'line' );\n\n# Configure the chart.\n$chart->addseries(\ncategories => '=Sheet1!$A$2:$A$7',\nvalues     => '=Sheet1!$B$2:$B$7',\n);\n\n# Add the worksheet data the chart refers to.\nmy $data = [\n[ 'Category', 2, 3, 4, 5, 6, 7 ],\n[ 'Value',    1, 4, 5, 2, 1, 5 ],\n];\n\n$worksheet->write( 'A1', $data );\n\nEND\n\n### DESCRIPTION\n\nThis module implements Line charts for Spreadsheet::WriteExcel. The chart object is created via\nthe Workbook \"addchart()\" method:\n\nmy $chart = $workbook->addchart( type => 'line' );\n\nOnce the object is created it can be configured via the following methods that are common to all\nchart classes:\n\n$chart->addseries();\n$chart->setxaxis();\n$chart->setyaxis();\n$chart->settitle();\n\nThese methods are explained in detail in Spreadsheet::WriteExcel::Chart. Class specific methods\nor settings, if any, are explained below.\n\n### Line Chart Methods\n\nThere aren't currently any line chart specific methods. See the TODO section of\nSpreadsheet::WriteExcel::Chart.\n\n### EXAMPLE\n\nHere is a complete example that demonstrates most of the available features when creating a\nchart.\n\n#!/usr/bin/perl -w\n\nuse strict;\nuse Spreadsheet::WriteExcel;\n\nmy $workbook  = Spreadsheet::WriteExcel->new( 'chartline.xls' );\nmy $worksheet = $workbook->addworksheet();\nmy $bold      = $workbook->addformat( bold => 1 );\n\n# Add the worksheet data that the charts will refer to.\nmy $headings = [ 'Number', 'Sample 1', 'Sample 2' ];\nmy $data = [\n[ 2, 3, 4, 5, 6, 7 ],\n[ 1, 4, 5, 2, 1, 5 ],\n[ 3, 6, 7, 5, 4, 3 ],\n];\n\n$worksheet->write( 'A1', $headings, $bold );\n$worksheet->write( 'A2', $data );\n\n# Create a new chart object. In this case an embedded chart.\nmy $chart = $workbook->addchart( type => 'line', embedded => 1 );\n\n# Configure the first series. (Sample 1)\n$chart->addseries(\nname       => 'Sample 1',\ncategories => '=Sheet1!$A$2:$A$7',\nvalues     => '=Sheet1!$B$2:$B$7',\n);\n\n# Configure the second series. (Sample 2)\n$chart->addseries(\nname       => 'Sample 2',\ncategories => '=Sheet1!$A$2:$A$7',\nvalues     => '=Sheet1!$C$2:$C$7',\n);\n\n# Add a chart title and some axis labels.\n$chart->settitle ( name => 'Results of sample analysis' );\n$chart->setxaxis( name => 'Test number' );\n$chart->setyaxis( name => 'Sample length (cm)' );\n\n# Insert the chart into the worksheet (with an offset).\n$worksheet->insertchart( 'D2', $chart, 25, 10 );\n\nEND\n\n### AUTHOR\n\nJohn McNamara jmcnamara@cpan.org\n\n### COPYRIGHT\n\nCopyright MM-MMX, John McNamara.\n\nAll Rights Reserved. This module is free software. It may be used, redistributed and/or modified\nunder the same terms as Perl itself.\n\n"
        }
    ],
    "structuredContent": {
        "command": "Spreadsheet::WriteExcel::Chart::Line",
        "section": "",
        "mode": "perldoc",
        "summary": "Line - A writer class for Excel Line charts.",
        "synopsis": "To create a simple Excel file with a Line chart using Spreadsheet::WriteExcel:\n#!/usr/bin/perl -w\nuse strict;\nuse Spreadsheet::WriteExcel;\nmy $workbook  = Spreadsheet::WriteExcel->new( 'chart.xls' );\nmy $worksheet = $workbook->addworksheet();\nmy $chart     = $workbook->addchart( type => 'line' );\n# Configure the chart.\n$chart->addseries(\ncategories => '=Sheet1!$A$2:$A$7',\nvalues     => '=Sheet1!$B$2:$B$7',\n);\n# Add the worksheet data the chart refers to.\nmy $data = [\n[ 'Category', 2, 3, 4, 5, 6, 7 ],\n[ 'Value',    1, 4, 5, 2, 1, 5 ],\n];\n$worksheet->write( 'A1', $data );\nEND",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [
            "Here is a complete example that demonstrates most of the available features when creating a",
            "chart.",
            "#!/usr/bin/perl -w",
            "use strict;",
            "use Spreadsheet::WriteExcel;",
            "my $workbook  = Spreadsheet::WriteExcel->new( 'chartline.xls' );",
            "my $worksheet = $workbook->addworksheet();",
            "my $bold      = $workbook->addformat( bold => 1 );",
            "# Add the worksheet data that the charts will refer to.",
            "my $headings = [ 'Number', 'Sample 1', 'Sample 2' ];",
            "my $data = [",
            "[ 2, 3, 4, 5, 6, 7 ],",
            "[ 1, 4, 5, 2, 1, 5 ],",
            "[ 3, 6, 7, 5, 4, 3 ],",
            "];",
            "$worksheet->write( 'A1', $headings, $bold );",
            "$worksheet->write( 'A2', $data );",
            "# Create a new chart object. In this case an embedded chart.",
            "my $chart = $workbook->addchart( type => 'line', embedded => 1 );",
            "# Configure the first series. (Sample 1)",
            "$chart->addseries(",
            "name       => 'Sample 1',",
            "categories => '=Sheet1!$A$2:$A$7',",
            "values     => '=Sheet1!$B$2:$B$7',",
            ");",
            "# Configure the second series. (Sample 2)",
            "$chart->addseries(",
            "name       => 'Sample 2',",
            "categories => '=Sheet1!$A$2:$A$7',",
            "values     => '=Sheet1!$C$2:$C$7',",
            ");",
            "# Add a chart title and some axis labels.",
            "$chart->settitle ( name => 'Results of sample analysis' );",
            "$chart->setxaxis( name => 'Test number' );",
            "$chart->setyaxis( name => 'Sample length (cm)' );",
            "# Insert the chart into the worksheet (with an offset).",
            "$worksheet->insertchart( 'D2', $chart, 25, 10 );",
            "END"
        ],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 28,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 16,
                "subsections": []
            },
            {
                "name": "Line Chart Methods",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "EXAMPLE",
                "lines": 50,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 5,
                "subsections": []
            }
        ]
    }
}