You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openoffice.apache.org by bu...@apache.org on 2016/07/20 07:11:50 UTC

[Issue 127050] New: I use API to generate a .ods file with chart, but the "LineDash" propert setting doesn't work

https://bz.apache.org/ooo/show_bug.cgi?id=127050

          Issue ID: 127050
        Issue Type: DEFECT
           Summary: I use API to generate a .ods file with chart, but the
                    "LineDash" propert setting doesn't work
           Product: Calc
           Version: 4.1.2
          Hardware: PC
                OS: Linux, all
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P5 (lowest)
         Component: programming
          Assignee: issues@openoffice.apache.org
          Reporter: zhangyaokai886@163.com

I am a Java application developer, and use OpenOffice API (some jar
package, like juh.jar  jurt.jar ridl.jar unoil.jar unoload.jar) to generate
a .ods file with chart in it. And I want change the dash style of each line
in the chart, so I use API function setPropertyValue("LineDash", myDash) to
set the "LineDash" property. But it doesn't work, the dash style in the
chart keep unchange after my setting.

my code is as following:

        aseriespro = xDiagram.getDataRowProperties(kk);
        aseriespro.setPropertyValue("LineStyle", LineStyle.DASH);
        LineDash  aDash = new LineDash();
        aDash.Style = DashStyle.ROUND;
        aDash.Dots = 2;
        aDash.DotLen = 100;
        aDash.Dashes = 1;
        aDash.DashLen =200;
        aDash.Distance =100;    
        aseriespro.setPropertyValue("LineDash", aDash);

And I have checked that:
1>  the data of aDash have been set successfully, because I use API
function getPropertyValue("LineDash") to check it
2>  The other properties can be set successfully, and works well, like
"LineColor" "LineWidth".

Seems only the "LineDash" doesn't work.   Thanks for your help in advance. 
Look forward to your reply.

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 127050] I use API to generate a .ods file with chart, but the "LineDash" propert setting doesn't work

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=127050

--- Comment #3 from hanya <ha...@gmail.com> ---
I could observe the problem that the LineColor is not changed sometimes in the
specific situation. 
When I execute Basic macro did not change the line color after return back from
the edit mode of the chart in the sheet of the calc document. But not every
time.
I have no idea how to avoid such problem.

Here is the code which I tried.
Sub Snippet2
  oSheets = ThisComponent.getSheets()
  oObj1 = oSheets.getByIndex(0)
  oCharts = oObj1.getCharts()
  oObj2 = oCharts.getByIndex(0)

  oEmbeddedObject = oObj2.getEmbeddedObject()
  oDiagram = oEmbeddedObject.getDiagram()

  oDataRowProperties = oDiagram.getDataRowProperties(0)
  'msgbox oDataRowProperties.LineColor
  if oDataRowProperties.LineColor <> 1973940 then
    oDataRowProperties.LineColor = 1973940
  else
    oDataRowProperties.LineColor = 15000000
  end if
end sub

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 127050] I use API to generate a .ods file with chart, but the "LineDash" propert setting doesn't work

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=127050

--- Comment #6 from kevinzhang <zh...@163.com> ---
Hi Hanya,

      Sorry to bother you again.

      I met a new issue: I use the method below to creat a chart, aAddresses
have 4 colums, so I got 3 line in chart, the leftmost colum is the X axis. And
I want change the P-axis name, if there is another method to help realize it.

aChartCollection.addNewByName("chart0", aRect, aAddresses, true, false);

And the Forth arg is help to  "if set to true, the topmost row of the source
data will be used to set labels for the category axis or the legend"

Thanks,

Yaokai

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 127050] I use API to generate a .ods file with chart, but the "LineDash" propert setting doesn't work

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=127050

orcmid <or...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |orcmid@apache.org

--- Comment #5 from orcmid <or...@apache.org> ---
(In reply to kevinzhang from comment #4)
> Hi Hanya,
I want to know if the SDK develop group have a plan to fix this
> defect?

There is no SDK development group, as such, any longer.

It is likely that there will be no fix.  Thanks for your workaround.

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 127050] I use API to generate a .ods file with chart, but the "LineDash" propert setting doesn't work

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=127050

--- Comment #2 from kevinzhang <zh...@163.com> ---
hi Hanya,

    Many thanks for your quickly reply, and I have a try with your suggestion,
using LineDashName, it works well. Thanks a lot!

    Actually, I have an other issue when I use API function to change the line
property in chart. The issue is it failed randomly when I set the properties,
like I set the "LineColor" "LineWidth" "SymbolStyle" etc. 

     that is very weird, because the properties setting failed randomly. And I
figure out a workaround to fixed this issue, but I think that is not a good
idea.

     My workaround code is as following: (I keep setting until the property be
set successfully ): 

        for (;;) {
            Integer color = 1973940;
            aseriespro = xDiagram.getDataRowProperties(1);

            aseriespro.setPropertyValue("LineColor", (color));
            KEY =
color.equals((Integer)aseriespro.getPropertyValue("LineColor"));
            if (KEY) {
                break;       
            }
        }
        aseriespro.setPropertyValue("LineStyle", LineStyle.DASH);
        .....
        .....

Would you please help to have a look? why I met that issue? and How can I avoid
this issue?

( If the funciton getDataRowProperties() is wrong usage)

Many Thanks,

Yaokai

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 127050] I use API to generate a .ods file with chart, but the "LineDash" propert setting doesn't work

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=127050

--- Comment #4 from kevinzhang <zh...@163.com> ---
Hi Hanya,

     Many thanks for your handly explain. Since we all met this random issue, I
want to know if the SDK develop group have a plan to fix this defect?

     Now I have a walkaround solution, which is showed in my last comment. For
now, this method can help implement my expected feature.

Thanks 

KevinZhang(Yaokai)

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 127050] I use API to generate a .ods file with chart, but the "LineDash" propert setting doesn't work

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=127050

hanya <ha...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |CONFIRMED
                 CC|                            |hanya.runo@gmail.com
     Ever confirmed|0                           |1

--- Comment #1 from hanya <ha...@gmail.com> ---
It looks LineDash property is not working. Try LineDashName property to set the
line dash style, leave LineDash property void.

-- 
You are receiving this mail because:
You are the assignee for the issue.