Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need macro for default fast type change

Hi,

I wanted to create a macro that should reset the default settings of the fast type change. Because I have 3 charts in the fast change bar , combo and straight and I want the combo chart to be default in few of my tables and in few tables I want the bar chart.

This is because when ever I change my chart from one to another the change chart will be my default. so, I want the scenario mentioned above so that I can reset before I am deploying

1 Solution

Accepted Solutions
sorrakis01
Specialist
Specialist

Hi,

I create an example.  A simple columns chart, with all the expresions of fast type change unselected. If you push button Chart, then the chart changes to line chart and select all values for fast type change.

I'll hope help it.

View solution in original post

11 Replies
sorrakis01
Specialist
Specialist

hi,

Look at this:

sub charts()

set chart = ActiveDocument.getsheetobject("OBJECT NAME")'.CreateBarChart

chart.AddDimension "DIMENSION NAME"

chart.AddExpression "EXPRESSION METRIC"

set p = chart.GetProperties

p.GraphLayout.FastChange.Bar = True

p.GraphLayout.FastChange.Line = true

p.GraphLayout.FastChange.Combo = true

p.GraphLayout.FastChange.Pie = true

p.GraphLayout.FastChange.Scatter = true

p.GraphLayout.FastChange.Straight = true

p.GraphLayout.FastChange.Pivot = false

p.ChartProperties.FastChangeInChart = FALSE

chart.SetProperties p

chart.SetChartType  4       'line

end sub

Regards

Not applicable
Author

As per my knowledge it will create a new chart and assigning the dimensions and expression and what are the fast type chart are required that is given

chart.SetChartType  4


what the above line of code do

sorrakis01
Specialist
Specialist

Hi,

You can use this line to put this type of char by default.

Regards,

Not applicable
Author

Its not working I tested it and showing an error in adddimension line itself

could you explain me because this is my first macro

sorrakis01
Specialist
Specialist

Hi,

Copy your code here, please

sorrakis01
Specialist
Specialist

Hi,

I create an example.  A simple columns chart, with all the expresions of fast type change unselected. If you push button Chart, then the chart changes to line chart and select all values for fast type change.

I'll hope help it.

kuba_michalik
Partner - Specialist
Partner - Specialist

It sets the chart type:

0   =   bar chart

1   =   pie chart

2   =   pivot table

3   =   scatter chart

4   =   line chart

5   =   straight table

6   =   combo chart

sorrakis01
Specialist
Specialist

Hi,

Then use this code in the line chart.SetChartType  (insert the number of the chart to show)

Regards

Not applicable
Author

Hi,

thats work fine but if  I have more than 2 charts in my sheet and I want to reset to all the charts then what should I do