Link to home
Start Free TrialLog in
Avatar of ksenthilraj
ksenthilraj

asked on

Office Web Component Commands

<%
'Add a Clustered Column Chart with a legend to the Chartspace
set m_cspace = server.CreateObject("OWC.Chart")
set cht = m_cspace.Charts.Add()
set c = m_cspace.Constants
cht.Type = c.chChartTypeColumnClustered
cht.HasLegend = True



'set the Chartspace's data source to the Recordset and add the
'SalesPerson field for series names, the Month field for the chart's
'categories and the Sales field for the chart's values
set m_cspace.DataSource = rs
cht.SetData c.chDimCategories, 0, "DATE"
cht.SetData c.chDimValues, 0, "TOTALNUMBEROFCALLS"

'add a chart title and format the title

cht.HasTitle = True
cht.Title.Caption = "JuzzFone Calls Report"
set fnt = cht.Title.Font
fnt.Name = "Tahoma"
fnt.Size = 10
fnt.Bold = True


'add a title to the category axis and format the title
set ax = cht.Axes(c.chAxisPositionBottom)
ax.HasTitle = True
ax.Title.Caption = "DATE"

''HERE I WANT FORM THE X AXIS DATES IN VERTICAL FORMAT


set fnt = ax.Title.Font
fnt.Name = "Tahoma"
fnt.Size = 8
fnt.Bold = True

'add a title to the value axis and format the title
set ax = cht.Axes(c.chAxisPositionLeft)
ax.HasTitle = True
ax.Title.Caption = "TOTALNUMBEROFCALLS"
set fnt = ax.Title.Font
fnt.Name = "Tahoma"
fnt.Size = 8
fnt.Bold = True

'Save the current chart to a GIF file with a temporary, unique filename
set m_fso = CreateObject("Scripting.FileSystemObject")
sFullFileName = Server.MapPath(".") & "\" & m_fso.GetTempName()
m_cspace.ExportPicture sFullFileName, "gif", 800, 400

'Use On Error Resume Next to make sure we eventually delete
'the temporary GIF file even if something fails in the next couple
'of functions
on error resume next

'The GIF file has been created. Return the contents of the GIF file as
'binary data using the BinaryFileStream ActiveX DLL
set m_objBinaryFile = server.CreateObject("BinaryFileStream.Object")
Response.BinaryWrite m_objBinaryFile.GetFileBytes(CStr(sFullFileName))

'Delete the GIF file since it is no longer needed
m_objBinaryFile.DeleteFile CStr(sFullFileName)

%>



Using the above code I am doing the Chart.. the problem is
the X axis  members (DATE)comes in the horizontal format which is not very good .. I would like to change it in the vertical format.. help pls..

With Cheers.
Avatar of ozymandias
ozymandias
Flag of United Kingdom of Great Britain and Northern Ireland image

I don't know which property you ned to set for this, or even if it is possible, but if it is it will be in the Object Reference Documentation for the MSOWC which you can download from Microsoft. The file you need is : MSOWCVBA.CHM. If you have MS Office installed you will probably find it here :

c:\program files\Microsoft Office\Office\1033\

The 1033 language code will be different if you have installed Office in a language other than US English.

Cheers.
Avatar of ASPGuru
ASPGuru

sorry, not possible...
Avatar of ksenthilraj

ASKER

Hai ASPGURu,

But it is possible in the EXCEL.. We are using Office web components only.. So I think it is possible but i doknow
the property name...

With Cheers.
Hai ASPGURu,

But it is possible in the EXCEL.. We are using Office web components only.. So I think it is possible but i doknow
the property name...

With Cheers.
> But it is possible in the EXCEL
yes!

> We are using Office web components only.. So I think it is possible but i doknow the property name

no!

OWC is not Excel... sorry.
MSOWC, is the web component API for the some of the Microsoft Office Components. It exposes a subset of the components' API. Obviously the setting that allows you to change the orientation of the tick lables on the chart axes is not part of the API subset that has been exposed, hence it is available in Excel but not via MSOWC.
cht.ax(xlValue).TickLables.fnt = xlTickLabelOrientationVertical

or (if you do not want to set the constants of he chart Object:

cht.ax(2).TickLables.fnt = -4166
You can use that API in Excel and other Office apps that use VBA, but I do not believe it will work using MSOWC. As I said, I don't think that part of the API is accessible from ASP pages.
ksenthilraj, read the documentation in MSOWCVBA.CHM and you'll see, that i'm right and that the chart component doesn't support what you want....
Dear Experts,

It is really very good response..

Now i am checking the MSOWCVBA.CHM  think as per your suggestion.

AspGuru Is it possible to draw the Line Graph as like this graph... If it is possible please give some code for that..

With Cheers
i'm not sure what you exactly want...

if you want to change the Type of the graph, then look in the documentation for wcchart.type... there are 40+ different types....
ok.. aspguru  what i really want is i  tild the
data's which are coming in the X- AXIS that is my first point..  

    !
    !
    !              
    !
----!--------------------------------
    !I WOULD LIKE TO TILT THE DATA'S VERTICALLY WHAT COMES   HERE.


I think this makes clear you...  

 
DATE

the second one I got from the help topics that the types of graphs..  

I need some links which contains OWC examples or you can provide..  I think this too high for this points .. if the comments are good then i will increase the points too.

With Cheers.

Dear Experts,

No reply..   Any comments..

WIth Cheers
ksenthilraj, I think we have established that using MSOWC from ASP it is not possible to acheive part one of you question, e.g to tilt the angle of the tick-labels on the x-axis.

For part two (the examples) the best place to look is on the Microsoft Dveloper Network (MSDN) website. Specifically, here : http://msdn.microsoft.com/library/en-us/off2000/html/ochowchartexamples.asp?frame=true

Cheers.
i don't know exactly what you mean with "tilt the data"...
if you want to print the text vertically, i already told you that this isn't possible..

for examples:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dno2kta/html/ofintrowbcom.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dno2kta/html/msowcbasics.asp
Thanks experts,

I changed the graph by other way.. So please  tell  wheather this is possible..

From the recordset different columns i am getting 20,30,40.
I would like to draw the graph in the Y axis one single bar
which contains 20 ,30,40(totally 90) with different colour for 20,30,40..

Is it possible.  I think i am asking too many questions..
Please address this question.

Thanks in advance..

With Cheers

yes, this is possible...

i think this is chChartTypeAreaStacked(30) for the chart type.... or any other stacked chart type - there are some...

lookup ChartChartTypeEnum in MSOWCVBA.CHM...
ASPGuru,

Can you give some link which having the example on this.

or I gave my code above .. give me the modification which

i have to do in that..

Since i am new to OWC I do know this.. In that example i

assign the recordset to the parameter.. If i would like to

give three columns to the same Y axis how to do this.. In

the help file search it gaves only the number 30 alone

nothing more than that..

With Cheers..
dear experts,.

I need some example for the above type of charts.. pls provide

With cheers
create the right chart in excel and puplish the sheet as a web page, then look which property are set...
 t his should give you an idea...

also read the second article i gave you a link to...
Hai,
yes, I will check your link now aspGuru

Thanks
aspGuru,

I tried out your link as well and excel save as method..

In the link very few things only available for the web

type processing of charts.. And there is no examples.

In the case of the save as method in the Excel.. I could

not understand what is happening.. it creates so many

sheets  in a additional folder and stored in that..

These things not clarified my doubts can you help me by

providing a example

With Cheers
ASKER CERTIFIED SOLUTION
Avatar of ASPGuru
ASPGuru

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
> I think this too high for this points
.. if the comments are good then i will increase the points too.

i hope you keep your promise...
ASPGuru,

Just now i saw your reply.. it is really fantastic reply
Guru..

The only thing i need from you I got the things from the database.. How this things will work when i am having my
record set...  

Pls.. clear this point.. even I am not yet gone through your code thoroughly... I would like to give the points to you...

Pls clear my doubt ya..

With Cheers
if the reply is so fantastic, then why you gave only poor 30 points? i thought you want to add more...
how much you want to add... and pls clear that database Datasource for the same method...

I am having three different columns named
column1  column2   column3


In the graph every vertical bar should be the

sum of
  column1+column2+column3..

Using datasource not by defining the array..  I think U understand what i want..

With Cheers
Hai  ASPGuru,

Thanks for your code.. But for your information I already saw this code in the OWC help file.. That's fine.. no issues.. I will give more points to you.. Pls. make this
chart getting information from the database..

I already post a comment regarding this...but no reply from you..

Thanks in advance for you help

With cheers.
ASPGuru,

Are you there??????

With Cheers,