chart.y_axis.crosses = 'min'
chart.y_axis.scaling.min = pc.vaxis.min
chart.y_axis.scaling.max = pc.vaxis.max
chart.plot_area.layout = openpyxl.chart.layout.Layout(manualLayout=openpyxl.
chart.layout.ManualLayout(yMode='edge', xMode='edge', x=my_x, y=my_y, h=my_height, w=my_width))
chart.y_axis.scaling.min = pc.vaxis.min
chart.y_axis.scaling.max = pc.vaxis.max
chart.y_axis.scaling.min = my_min
chart.y_axis.scaling.max = my_max
--
You received this message because you are subscribed to a topic in the Google Groups "openpyxl-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openpyxl-users/QR8I42obeqk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openpyxl-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
ch.title.tx.rich.p[0].r.rPr.sz=5
ch.title.text.rich.paragraphs[0].r.properties.sz=5
I think that's already the case it's just fucking impossible™ to work
with! ;-) But I did test reading with this yesterday (primitives for this
will be in 2.4 for the brave of heart but not the whole thing).
openpyxl.chart.title.title_maker will already convert a stream of text
into paragraphs. So I'm not sure what more you need. Supporting
"sub-atomic" nightmare in the API just isn't easy.
ch = chart.ScatterChart()
ch.title = self.chart_title
ch.title.tx.rich.p[0].r.rPr.sz=5
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'sz'
Am .02.2016, 11:09 Uhr, schrieb Thomas Nygårds <thomas...@gmail.com>:
>
>
>> I think that's already the case it's just fucking impossible™ to work
>> with! ;-) But I did test reading with this yesterday (primitives for
>> this
>>
>> will be in 2.4 for the brave of heart but not the whole thing).
>>
>> openpyxl.chart.title.title_maker will already convert a stream of text
>> into paragraphs. So I'm not sure what more you need. Supporting
>> "sub-atomic" nightmare in the API just isn't easy.
>>
>
> Ok. Sound like I need an upgrade when 2.4 is out then...
> because running the code
> ch = chart.ScatterChart()
> ch.title = self.chart_title
> ch.title.tx.rich.p[0].r.rPr.sz=5
from openpyxl.drawing.text import CharacterProperties
...
ch.title.tx.rich.p[0].r.rPr = CharacterProperties(sz=5, b=True)
...
ch.title="test1"
ch.title.tx.rich.p[0].r.rPr = CharacterProperties(sz=5, b=True)
ws.add_chart(ch, "A10")
wb.save("chart_title.xlsx")
Try with a 2.4 checkout.
Try with a 2.4 checkout. But you might want to create your own
"title_maker" function for this kind of thing.
from openpyxl import Workbook, load_workbook
from openpyxl import chart
from openpyxl.drawing.text import CharacterProperties
wb = Workbook()
ws = wb.active
rows = [
['Size', 'Batch 1'],
[2, 40],
[3, 40],
[4, 50],
[5, 30],
[6, 25],
[7, 20],
]
for row in rows:
ws.append(row)
ch = chart.ScatterChart()
ch.scatterStyle = "marker"
ch.title = "Scatter Chart"
ch.title.tx.rich.p[0].r.rPr = CharacterProperties(sz=5, b=True)
ch.style = 13
ch.x_axis.title = 'Size'
ch.y_axis.title = 'Percentage'
ch.x_axis.scaling.logBase = 10
xvalues = chart.Reference(ws, min_col=1, min_row=2, max_row=7)
values = chart.Reference(ws, min_col=2, min_row=1, max_row=7)
series = chart.Series(values, xvalues, title_from_data=True)
ch.series.append(series)
ws.add_chart(ch, "A10")
wb.save("chart_title.xlsx")
Having played with the module for the last couple of days I agree that the api is terrible. However it seems like I can achieve almost anything and have had pretty good success with title formats, series line and marker formats, error bars, axis scaling, tick labels and gridlines. Openpyxl seems to create very nice files with abundant features.
One thing is escaping me though. I can't for the life of me figure out how to make a line have some transparency. Any direction on something like that?
--
You received this message because you are subscribed to a topic in the Google Groups "openpyxl-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openpyxl-users/QR8I42obeqk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openpyxl-users+unsubscribe@googlegroups.com.