            CreateGraf01("res.xlsx");
            Process.Start("res.xlsx");


        public static void CreateGraf01(string outputPath)
        {

            Workbook workbook = new Workbook();
            //Initailize worksheet
            workbook.CreateEmptySheets(1);
            Worksheet sheet = workbook.Worksheets[0];
            sheet.Name = "TRA";
            sheet.GridLinesVisible = false;
            //Writes chart data
            CreateChartData(sheet);
            //Add a new chart worsheet to workbook
            Chart chart = sheet.Charts.Add();
            chart.ChartType = ExcelChartType.Line;
            //Set position of chart
            chart.LeftColumn = 1;
            chart.TopRow = 6;
            chart.RightColumn = 11;
            chart.BottomRow = 29;
            //Chart title
            chart.ChartTitle = "";
            //Set region of chart data
            chart.DataRange = sheet.Range["B1:H2"];
            chart.SeriesDataFromRange = true;

            Spire.Xls.Charts.ChartSerie cs = chart.Series[0];

            //Chart Labels resource
            cs.CategoryLabels = sheet.Range["B1:H1"];
            //Chart value resource
            cs.Values = sheet.Range["B2:H2"];

            cs.UsePrimaryAxis = true;

            //Division Lines
            chart.PrimaryCategoryAxis.HasMajorGridLines = true;
            chart.PrimaryCategoryAxis.HasMinorGridLines = true;
            chart.PrimaryValueAxis.HasMajorGridLines = true;
            chart.PrimaryValueAxis.HasMinorGridLines = true;
            chart.SecondaryCategoryAxis.HasMajorGridLines = true;
            chart.SecondaryCategoryAxis.HasMinorGridLines = true;
            chart.SecondaryValueAxis.HasMajorGridLines = true;
            chart.SecondaryValueAxis.HasMinorGridLines = true;
            //Division Lines Color

            chart.PrimaryValueAxis.MajorGridLines.LineProperties.Color = Color.Red;
            chart.PrimaryValueAxis.MinorGridLines.LineProperties.Color = Color.Black;
            chart.PrimaryCategoryAxis.MajorGridLines.LineProperties.Color = Color.Red;
            chart.PrimaryCategoryAxis.MinorGridLines.LineProperties.Color = Color.Black;

            chart.PrimaryCategoryAxis.CrossValue = 0;
            chart.PrimaryValueAxis.CrossValue = 0;
            chart.SecondaryCategoryAxis.CrossValue = 0;
            chart.SecondaryValueAxis.CrossValue = 0;




            //Chart Axes
            chart.PrimaryCategoryAxis.Title = "%Elongacin";
            chart.PrimaryCategoryAxis.LabelFrequency = 1;
            chart.PrimaryCategoryAxis.MinValue = 1;
            chart.PrimaryCategoryAxis.MaxValue = 7;
            chart.PrimaryCategoryAxis.Font.Color = Color.Black;
            chart.PrimaryCategoryAxis.AxisBetweenCategories = false;

            chart.PrimaryValueAxis.IsReverseOrder = false;
            chart.PrimaryValueAxis.Title = "Fuerza (KN)";
            //chart.PrimaryValueAxis.IsAutoCross = true;
            chart.PrimaryValueAxis.MinValue = 0;
            chart.PrimaryValueAxis.MaxValue = 140;
            chart.PrimaryValueAxis.CrossesAt = 0;
            chart.PrimaryValueAxis.TitleArea.TextRotationAngle = 0;
            chart.PrimaryValueAxis.TitleArea.X = 350;
            chart.PrimaryValueAxis.TitleArea.Y = 250;

            chart.SecondaryCategoryAxis.Title = "Fuerza1 (KN)";
            chart.SecondaryValueAxis.Title = "SecondaryValueAxis";
            chart.PrimaryValueAxis.TitleArea.IsBold = true;
            chart.PlotArea.Visible = false;
            chart.Legend.Delete();
            workbook.SaveToFile(outputPath);

        }
        private static void CreateChartData(Worksheet sheet)
        {
            sheet.Range["B1"].Value = "0";
            sheet.Range["B2"].NumberValue = 0;
            sheet.Range["C1"].Value = "1";
            sheet.Range["C2"].NumberValue = 7.5;
            sheet.Range["D1"].Value = "2";
            sheet.Range["D2"].NumberValue = 7.7;
            sheet.Range["E1"].Value = "3";
            sheet.Range["E2"].NumberValue = 8;
            sheet.Range["F1"].Value = "4";
            sheet.Range["F2"].NumberValue = 98;
            sheet.Range["G1"].Value = "5";
            sheet.Range["G2"].NumberValue = 100;
            sheet.Range["H1"].Value = "6";
            sheet.Range["H2"].NumberValue = 110;
            sheet.Range["B2:H2"].Style.NumberFormat = "0.0"; //"\"$\"#,##0";
        }