{
    "content": [
        {
            "type": "text",
            "text": "# Spreadsheet::WriteExcel::Chart::Bar (perldoc)\n\n## NAME\n\nBar - A writer class for Excel Bar charts.\n\n## SYNOPSIS\n\nTo create a simple Excel file with a Bar 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 => 'bar' );\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## DESCRIPTION\n\nThis module implements Bar charts for Spreadsheet::WriteExcel. The chart object is created via\nthe Workbook \"addchart()\" method:\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **Bar Chart Methods**\n- **EXAMPLE**\n- **AUTHOR**\n- **COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Spreadsheet::WriteExcel::Chart::Bar",
        "section": "",
        "mode": "perldoc",
        "summary": "Bar - A writer class for Excel Bar charts.",
        "synopsis": "To create a simple Excel file with a Bar 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 => 'bar' );\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( 'chartbar.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 => 'bar', 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": "Bar Chart Methods",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "EXAMPLE",
                "lines": 50,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Bar - A writer class for Excel Bar charts.\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "To create a simple Excel file with a Bar 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 => 'bar' );\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",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This module implements Bar charts for Spreadsheet::WriteExcel. The chart object is created via\nthe Workbook \"addchart()\" method:\n\nmy $chart = $workbook->addchart( type => 'bar' );\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",
                "subsections": []
            },
            "Bar Chart Methods": {
                "content": "There aren't currently any bar chart specific methods. See the TODO section of\nSpreadsheet::WriteExcel::Chart.\n",
                "subsections": []
            },
            "EXAMPLE": {
                "content": "Here 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( 'chartbar.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 => 'bar', 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",
                "subsections": []
            },
            "AUTHOR": {
                "content": "John McNamara jmcnamara@cpan.org\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright 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",
                "subsections": []
            }
        }
    }
}