Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
Not applicable

Re: Need macro for default fast type change

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.

11 Replies
sorrakis01
Not applicable

Re: Need macro for default fast type change

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

Re: Need macro for default fast type change

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
Not applicable

Re: Need macro for default fast type change

Hi,

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

Regards,

Not applicable

Re: Need macro for default fast type change

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
Not applicable

Re: Need macro for default fast type change

Hi,

Copy your code here, please

sorrakis01
Not applicable

Re: Need macro for default fast type change

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
Not applicable

Re: Need macro for default fast type change

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
Not applicable

Re: Need macro for default fast type change

Hi,

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

Regards

Not applicable

Re: Need macro for default fast type change

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