Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Change graph data and objects through script

Participant ,
Aug 06, 2014 Aug 06, 2014

Hi. I'm working on a document where I had to create several pie charts on Illustrator. I then colored each pie's slices with swatches from a custom swatch group. Now I need to change the order of the slices, which would mean manually changing the values that generate the pies and then recoor each slice again.

I've been looking through the Illustrator CC Scripting Reference: Javascript but I haven't found any way to manipulate a GraphItem's objects or the data that generates them.

Is there any way to script any of these two tasks:

1. Sort the data on a graph.

2. Select the individual contents on a graph and alter their properties.

Thank you.

TOPICS
Scripting
612
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Aug 07, 2014 Aug 07, 2014

you're out of luck, there's no access to the graph data through scripting

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 08, 2014 Aug 08, 2014
LATEST

Bummer. But thank you.

The solution I came up with to at least get some of the work done through a script was to:

- change the graph data manually (I can sort it in Excel or similar) and create a new graph;

- apply a script to get the colors from the original graph into a new swatch group;

- name the colors with the calculated area value of their corresponding slice;

- get a list of these colors, then sort it, which gets them on the same order as the new pir chart slices;

- ungroup the new graph (it stops being a graph, but what the heck) and apply the sorted colors to the slices.

Hope this might be of use to someone.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines