[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Review Request: New patch for ChartShape to show the percentage
From:       "Pavol Korinek" <pavol.korinek () ixonos ! com>
Date:       2010-10-14 12:21:49
Message-ID: 20101014122149.16040.27929 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On 2010-10-06 13:04:28, Johannes Simon wrote:
> > I'm sorry if I didn't make myself clear before, but I strongly discoura=
ge you from changing code in KD Chart. It is not part of KOffice. Instead y=
ou should utilize KD Chart, as I pointed out in my last comment. The copy w=
ill eventually, after the release of 2.3, be removed from our source tree.
> =

> Pavol Korinek wrote:
>     Hello, Yes, I have tried different approach, because: 1. I haven't us=
e suffix, because I think that this is for something else - like suffix whi=
ch can be set for cell type. I have found that there's % like 'type' for ce=
ll and suffix is something possibly more to add. 2. in case I use suffix, I=
 haven't used Axis::plotAreaChartSubTypeChanged as you wanted, because diag=
ram is null at call time. Axis::plotAreaChartSubTypeChanged also call setTy=
pe, so I can add setSuffix to setType like Miroslav did. Method setType is =
also called on diagram create. 3. if I'll do it so, you don't recommend ano=
ther Miroslav's change in KDChartAbstractDiagram.cpp to modify itemRowLabel=
s() to call unitSuffix( i, Qt::Horizontal, false ). Do you agree to change =
it to: unitSuffix( i, Qt::Horizontal, d->percent) ?
> =

> Johannes Simon wrote:
>     1. I admit that my very first comment was a bit misleading. So never =
mind using KDChart::DataValueAttributes::setSuffix(). ;-) It's for modifyin=
g data point labels, not axis labels.
>     3. I promise, not a single change in KD Chart is needed. :-)
>     =

>     2. Ok, you're right. d->kd[Bar/Line/Area]Diagram is sometimes null ev=
en if their respective chart type is set. This is not a problem, but we nee=
d to do this slightly differerently then. Since we need to save all propert=
ies of the axis to ODF (and load it from ODF, too), it's best to store the =
suffix somewhere in our class Axis. I've done a small bit of research, and =
there's actually a namespace in the libs for handling this and more, it's c=
alled KoOdfNumberStyles. See libs/odf/KoOdfNumberStyles.h . So loading this=
 from /saving this to ODF is already supported by that namespace.
>     =

>     So three things that need to be done:
>     1) Use KoOdfNumberStyles::NumericStyleFormat to store current suffix =
in class Axis
>     2) Automatically set the correct suffix in Axis::plotAreaChartSubtype=
Changed().
>     3) Implement loading/saving of this using KoOdfNumberStyles::loadOdfN=
umberStyle() and KoOdfNumberStyles::saveOdf[TYPE]Style().
> =

> Johannes Simon wrote:
>     I forgot the key part ;-) There has to be some method that tells KD C=
hart about this. Like Axis::Private::updateKDChart() which then updates all=
 relevant properties in d->kd[...]Diagram using e.g. setUnitSuffix(). updat=
eKDChart() is then called whenever the suffix changed as well as from d->cr=
eate[...]Diagram(). In other words, updateKDChart() would function as a sim=
ple adapter between the chart shape's Axis and KD Chart.
> =

> Pavol Korinek wrote:
>     Hello, there's (KoXmlNS::chart, "percentage") in PlotArea class. Plot=
Area class uses and store Axis. Do we need such duplicity of number type fo=
r axis ? If i'll use setUnitSuffix() than we have problem that same suffix =
will be used also for labels. And you don't want to modify KDChartAbstractD=
iagram which uses: AbstractDiagram::itemRowLabels() which calls: unitSuffix=
(). Can It be solved without modifing KDchart ?
> =

> Johannes Simon wrote:
>     If you look at the ODF spec closely, paragraph 10.8, section "Style",=
 it says: "Text properties can also be applied to axes; see section 15.4". =
You can set the axis text label's style to whatever you want, just try it i=
n OOo. That is independent of the chart type/class.
>     =

>     I don't see why you want to modify KDChartAbstractDiagram. All this m=
ight change is a certain "default assumption" by KD Chart as to what text s=
tyle (% suffix or not) you'd like to have when your diagram is in percent-s=
tyle. This is irrelevant for us as we need to handle *all* cases, not just =
the best default assumption. Create a percent-bar diagram with OOo, modify =
the axis' text style to 'text', and there goes your % suffix ;-) (the 'text=
' style uses no prefix or suffix at all)

It's not about changing KDChartAbstractDiagram. It's about behaviour of KDc=
hart. You probaly remember Miroslav's patch. He had used setUnitSufix too. =
Than he had problem. He modified axis, but also labels. To not modify label=
s he modified KDChartAbstractDiagram to call unitSuffix with false argument=
, what is wrong. Do you want me to use setUnitSuffix to set % as suffix ? H=
ow to prevent modifing labes too ?


- Pavol


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/5535/#review7997
-----------------------------------------------------------


On 2010-10-06 08:44:55, Pavol Korinek wrote:
> =

> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/5535/
> -----------------------------------------------------------
> =

> (Updated 2010-10-06 08:44:55)
> =

> =

> Review request for KOffice.
> =

> =

> Summary
> -------
> =

> Patch for Chart Cartesian Axis to show the percentage symbol when diagram=
 has percentage mod
> =

> =

> Diffs
> -----
> =

>   /trunk/koffice/plugins/chartshape/kdchart/src/KDChartCartesianAxis.cpp =
1182951 =

> =

> Diff: http://svn.reviewboard.kde.org/r/5535/diff
> =

> =

> Testing
> -------
> =

> =

> Thanks,
> =

> Pavol
> =

>


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://svn.reviewboard.kde.org/r/5535/">http://svn.reviewboard.kde.org/r/5535/</a>
  </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On October 6th, 2010, 1:04 p.m., <b>Johannes \
Simon</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  <pre style="white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">I&#39;m sorry if I didn&#39;t make myself clear before, but I strongly \
discourage you from changing code in KD Chart. It is not part of KOffice. Instead you \
should utilize KD Chart, as I pointed out in my last comment. The copy will \
eventually, after the release of 2.3, be removed from our source tree.</pre>  \
</blockquote>




 <p>On October 7th, 2010, 6:48 a.m., <b>Pavol Korinek</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Hello, Yes, I have tried \
different approach, because: 1. I haven&#39;t use suffix, because I think that this \
is for something else - like suffix which can be set for cell type. I have found that \
there&#39;s % like &#39;type&#39; for cell and suffix is something possibly more to \
add. 2. in case I use suffix, I haven&#39;t used Axis::plotAreaChartSubTypeChanged as \
you wanted, because diagram is null at call time. Axis::plotAreaChartSubTypeChanged \
also call setType, so I can add setSuffix to setType like Miroslav did. Method \
setType is also called on diagram create. 3. if I&#39;ll do it so, you don&#39;t \
recommend another Miroslav&#39;s change in KDChartAbstractDiagram.cpp to modify \
itemRowLabels() to call unitSuffix( i, Qt::Horizontal, false ). Do you agree to \
change it to: unitSuffix( i, Qt::Horizontal, d-&gt;percent) ?</pre>  </blockquote>





 <p>On October 7th, 2010, 3:49 p.m., <b>Johannes Simon</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">1. I admit that my very \
first comment was a bit misleading. So never mind using \
KDChart::DataValueAttributes::setSuffix(). ;-) It&#39;s for modifying data point \
labels, not axis labels. 3. I promise, not a single change in KD Chart is needed. :-)

2. Ok, you&#39;re right. d-&gt;kd[Bar/Line/Area]Diagram is sometimes null even if \
their respective chart type is set. This is not a problem, but we need to do this \
slightly differerently then. Since we need to save all properties of the axis to ODF \
(and load it from ODF, too), it&#39;s best to store the suffix somewhere in our class \
Axis. I&#39;ve done a small bit of research, and there&#39;s actually a namespace in \
the libs for handling this and more, it&#39;s called KoOdfNumberStyles. See \
libs/odf/KoOdfNumberStyles.h . So loading this from /saving this to ODF is already \
supported by that namespace.

So three things that need to be done:
1) Use KoOdfNumberStyles::NumericStyleFormat to store current suffix in class Axis
2) Automatically set the correct suffix in Axis::plotAreaChartSubtypeChanged().
3) Implement loading/saving of this using KoOdfNumberStyles::loadOdfNumberStyle() and \
KoOdfNumberStyles::saveOdf[TYPE]Style().</pre>  </blockquote>





 <p>On October 7th, 2010, 4:09 p.m., <b>Johannes Simon</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I forgot the key part \
;-) There has to be some method that tells KD Chart about this. Like \
Axis::Private::updateKDChart() which then updates all relevant properties in \
d-&gt;kd[...]Diagram using e.g. setUnitSuffix(). updateKDChart() is then called \
whenever the suffix changed as well as from d-&gt;create[...]Diagram(). In other \
words, updateKDChart() would function as a simple adapter between the chart \
shape&#39;s Axis and KD Chart.</pre>  </blockquote>





 <p>On October 14th, 2010, 9:09 a.m., <b>Pavol Korinek</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Hello, there&#39;s \
(KoXmlNS::chart, &quot;percentage&quot;) in PlotArea class. PlotArea class uses and \
store Axis. Do we need such duplicity of number type for axis ? If i&#39;ll use \
setUnitSuffix() than we have problem that same suffix will be used also for labels. \
And you don&#39;t want to modify KDChartAbstractDiagram which uses: \
AbstractDiagram::itemRowLabels() which calls: unitSuffix(). Can It be solved without \
modifing KDchart ?</pre>  </blockquote>





 <p>On October 14th, 2010, 11:56 a.m., <b>Johannes Simon</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">If you look at the ODF \
spec closely, paragraph 10.8, section &quot;Style&quot;, it says: &quot;Text \
properties can also be applied to axes; see section 15.4&quot;. You can set the axis \
text label&#39;s style to whatever you want, just try it in OOo. That is independent \
of the chart type/class.

I don&#39;t see why you want to modify KDChartAbstractDiagram. All this might change \
is a certain &quot;default assumption&quot; by KD Chart as to what text style (% \
suffix or not) you&#39;d like to have when your diagram is in percent-style. This is \
irrelevant for us as we need to handle *all* cases, not just the best default \
assumption. Create a percent-bar diagram with OOo, modify the axis&#39; text style to \
&#39;text&#39;, and there goes your % suffix ;-) (the &#39;text&#39; style uses no \
prefix or suffix at all)</pre>  </blockquote>








</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">It&#39;s not about \
changing KDChartAbstractDiagram. It&#39;s about behaviour of KDchart. You probaly \
remember Miroslav&#39;s patch. He had used setUnitSufix too. Than he had problem. He \
modified axis, but also labels. To not modify labels he modified \
KDChartAbstractDiagram to call unitSuffix with false argument, what is wrong. Do you \
want me to use setUnitSuffix to set % as suffix ? How to prevent modifing labes too \
?</pre> <br />








<p>- Pavol</p>


<br />
<p>On October 6th, 2010, 8:44 a.m., Pavol Korinek wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://svn.reviewboard.kde.orgrb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for KOffice.</div>
<div>By Pavol Korinek.</div>


<p style="color: grey;"><i>Updated 2010-10-06 08:44:55</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Patch for Chart Cartesian Axis to show the percentage symbol when \
diagram has percentage mod</pre>  </td>
 </tr>
</table>





<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/trunk/koffice/plugins/chartshape/kdchart/src/KDChartCartesianAxis.cpp <span \
style="color: grey">(1182951)</span></li>

</ul>

<p><a href="http://svn.reviewboard.kde.org/r/5535/diff/" style="margin-left: \
3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>



_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic