Sign UpSign Up   Sign InSign In Welcome Guest,
Live Chat Live Chat

ValueAxis.set{Min, Max}Value() in Logarithmic Chart

Last post 09-06-2010, 4:07 AM by chimerast. 5 replies.
Sort Posts: Previous Next
  •  09-02-2010, 11:47 AM 256852

    ValueAxis.set{Min, Max}Value() in Logarithmic Chart Java

    Hi,

    I'm trying to create logarithmic chart with Aspose.Cells for Java.
    And I want to set ValueAxis's minimum value and maximum value.
    But It only accepts a logarithmic value in INTEGER.
    How can I set a logarithmic value in double or a non-logarithmic value?

    I works with version 2.4.0 .

    Regerds,

    --
    Hideyuki TAKEUCHI

     
  •  09-02-2010, 5:25 PM 256895 in reply to 256852

    Re: ValueAxis.set{Min, Max}Value() in Logarithmic Chart

    Attachment: Present (inaccessible)
    Hi,

    Thanks for your inquiry.

    Well, using Aspose.Cells for Java 2.4.0, I was able to set double / log values for Min and Max Vertical Axis of Scatter Chart Type. The Excel file create from the below code is attached for your reference.

            try {
            //Instantiating a Workbook object
            Workbook workbook = new Workbook();
            //Access firs sheet
            Worksheet worksheet = workbook.getWorksheets().getSheet(0);
            //Add Scatter type chart
            int chartIndex = worksheet.getCharts().add(ChartType.SCATTER, 5, 0, 15, 5);
            //Accessing the instance of the newly added chart
            Chart chart = worksheet.getCharts().getChart(chartIndex);
            //Set cell values
            worksheet.getCells().getCell("A1").setValue("x");
            worksheet.getCells().getCell("A2").setValue("y");
            worksheet.getCells().getCell("B1").setValue(0);
            worksheet.getCells().getCell("B2").setValue(0);
            worksheet.getCells().getCell("C1").setValue(0.3);
            worksheet.getCells().getCell("C2").setValue(0.3);
            worksheet.getCells().getCell("D1").setValue(0.7);
            worksheet.getCells().getCell("D2").setValue(0.6);
            worksheet.getCells().getCell("E1").setValue(1);
            worksheet.getCells().getCell("E2").setValue(1.2);
            worksheet.getCells().getCell("F1").setValue(1.3);
            worksheet.getCells().getCell("F2").setValue(2.41);

            //Add chart data source
            chart.getNSeries().add("A1:F2",true);
            //Set vertical min value
            chart.getValueAxis().setMinValue(0.5);
            //Set vertical max value
            chart.getValueAxis().setMaxValue(2.5);
            //Save workbook
            workbook.save("d:\\chartLogJ.xls");
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

    If you find such issue in some particular scenario, please provide us the sample application showing the issue. We will investigate it further.

    Kind Regards

    Muhammad Sabir
    Support Assistant Manager
    Aspose Sialkot Team
    http://www.aspose.com
    Aspose - Your File Format Experts

    Keep in touch! We're on Twitter and Facebook
     
  •  09-03-2010, 12:11 AM 256905 in reply to 256895

    Re: ValueAxis.set{Min, Max}Value() in Logarithmic Chart

    Hi, Muhammad

    Thank you for your response.

    I want to create logarithmic chart.

    So, your code shuold be 

            //Add chart data source
            chart.getNSeries().add("A1:F2",true);

            // ADDED: Set plotting logarithmic
            chart.getValueAxis().setLogarithmic(true);

            //Set vertical min value
            chart.getValueAxis().setMinValue(0.5);
            //Set vertical max value
            chart.getValueAxis().setMaxValue(2.5);

    And this code generate Excel file with ValueAxis,
    its minvalue is 1 = (log10((int) 0.5)) and maxvalue is 100 = (log10((int) 2.5)).

    I want to set minvalue to 200 in Excel file.

    Regards,

    --
    Hideyuki TAKEUCHI

     
  •  09-03-2010, 10:39 AM 257007 in reply to 256905

    Re: ValueAxis.set{Min, Max}Value() in Logarithmic Chart

    Hi,

    Thanks for sharing further details.

    The mentioned issue has been logged into our Issue Tracking System as 19792 for further investigations. We will update you about our findings regarding your requirement.

    Kind Regards

    Muhammad Sabir
    Support Assistant Manager
    Aspose Sialkot Team
    http://www.aspose.com
    Aspose - Your File Format Experts

    Keep in touch! We're on Twitter and Facebook
     
  •  09-06-2010, 2:13 AM 257157 in reply to 257007

    Re: ValueAxis.set{Min, Max}Value() in Logarithmic Chart

    Hi,

    After further investigation, we don't think MS EXCEL2003 can support such a feature. You cannot set such max/min values e.g 0.5/2.5 in MS EXCEL2003 manually, you may confirm it too. In MS EXCEL2007, such values can be set properly. And, if saving the workbook as Excel2007 file formats, such values will be saved correctly by Aspose.Cells for Java too. Therefore, we can say it is the limitation and behaviors put forth by different MS Excel versions (e.g XLS (2003) and XLSX(2007)).

    Thank you.


    Amjad Sahi
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  09-06-2010, 4:07 AM 257168 in reply to 257157

    Re: ValueAxis.set{Min, Max}Value() in Logarithmic Chart

    Hi,

    OK, I checked it with MS EXCEL2003 machine and I understood why it was.
    I had checked it in MS EXCEL2007 only.

    Thank you for your quick and thorough response.

    --
    Hideyuki Takeuchi

     
View as RSS news feed in XML