Ayuda: ToolTip en grafico FoxCharts

155 views
Skip to first unread message

Alejandro Garcia G.

unread,
Oct 7, 2016, 5:16:47 PM10/7/16
to Comunidad de Visual Foxpro en Español
Desde hace días he estado implementando unos graficos para una empresa, tengo un detalle, en un formulario normal, le he colocado que me muestre los tips (showtips = .T.) pero no lo hace en el grafico y no doy por que sucede esto. Coloco el código del metodo INIT del formulario pues no tiene mas que ese código y el de salida en un botón:

SET TALK OFF
SET CONSOLE OFF
SET DELETED ON

DIMENSION laNombres (8)

laNombres(1) = 'Saldo total'
laNombres(2) = 'Al día'
laNombres(3) = 'De 1 a 30'
laNombres(4) = 'De 31 a 60'
laNombres(5) = 'De 61 a 90'
laNombres(6) = 'De 91 a 180'
laNombres(7) = 'De mas de 180'
laNombres(8) = 'De mas de 360'


CREATE CURSOR crsCartera (desc c(25), valorlib n(12), valoraldia n(12), valor0 n(12), valor30 n(12), valor60 n(12), valor90 n(12), valor180 n(12), ;
    valorm180 n(12), valorm360 n(12))

SELECT 'Cartera' AS cedula, SUM(sallib) AS saldolib, SUM(edadaldia) + SUM(edad0) AS edadaldia, SUM(edad30) AS edad30, SUM(edad60) AS edad60, ;
    SUM(edad90) AS edad90, SUM(edad180) AS edad180, SUM(edadm180) AS edadm180, SUM(edadm360) AS edadm360 ;
    FROM c_clientes INTO CURSOR cc_clientes

SELECT crsCartera
GO TOP
FOR i = 1 TO 8
    INSERT INTO crsCartera (desc) VALUES (laNombres(i))
ENDFOR
GO TOP
SELECT cc_clientes
DIMENSION laValores(8)

laValores(1) = saldolib
laValores(2) = edadaldia
laValores(3) = edad30
laValores(4) = edad60
laValores(5) = edad90
laValores(6) = edad180
laValores(7) = edadm180
laValores(8) = edadm360

SELECT crsCartera
GO TOP
UPDATE crsCartera SET valorlib = laValores(1) WHERE desc = laNombres(1)
UPDATE crsCartera SET valoraldia = laValores(2) WHERE desc = laNombres(2)
UPDATE crsCartera SET valor30 = laValores(3) WHERE desc = laNombres(3)
UPDATE crsCartera SET valor60 = laValores(4) WHERE desc = laNombres(4)
UPDATE crsCartera SET valor90 = laValores(5) WHERE desc = laNombres(5)
UPDATE crsCartera SET valor180 = laValores(6) WHERE desc = laNombres(6)
UPDATE crsCartera SET valorm180 = laValores(7) WHERE desc = laNombres(7)
UPDATE crsCartera SET valorm360 = laValores(8) WHERE desc = laNombres(8)

LOCAL loChart
loChart = THIS

WITH Thisform.FoxCharts1 as FoxCharts OF "FoxCharts.vcx"

    .ChartType = 9 && Line

    * Then, we need to tell the class that it will receive 3 fields of data
    * Each field will represent one line
    * Later you can try changing the value of the property "ChartType" with values from 1 to 14
    * Be careful because we don't have Charttype #3 available yet :-)

    .ChartsCount = 8

    * Then we tell FoxCharts the name of the cursor that contains the data needed
    .SourceAlias = "crsCartera"
    .FieldAxis2 = "desc"

    * Next step is to populate the collection object that will receive the information from the cursor

    .FIELDS(1).FieldValue = "valorlib" && This is the name of the 1st column of the cursor
    .FIELDS(1).Legend = "Cartera Total"
    .TOOLTIP.Caption = TRANSFORM(valorlib, '@$ 999,999,9999,999')
    .FIELDS(1).COLOR  = RGB(100, 175, 213) && Blue

    .FIELDS(2).FieldValue = "valoraldia" && This is the name of the 1st column of the cursor
    .FIELDS(2).Legend = "Al día"
    .FIELDS(2).COLOR  = RGB(128, 0,    0) &&

    .FIELDS(3).FieldValue = "valor30" && This is the name of the 3st column of the cursor
    .FIELDS(3).Legend = "De 1 a 30 días"
    .FIELDS(3).COLOR  = RGB(90, 250, 50) && Green

    .FIELDS(4).FieldValue = "valor60" && This is the name of the 1st column of the cursor
    .FIELDS(4).Legend = "De 31 a 60 días"
    .FIELDS(4).COLOR  = RGB(142, 56, 142)

    .FIELDS(5).FieldValue = "valor90" && This is the name of the 2st column of the cursor
    .FIELDS(5).Legend = "De 61 a 90 días"
    .FIELDS(5).COLOR  = RGB(113, 113, 198)

    .FIELDS(6).FieldValue = "valor180" && This is the name of the 3st column of the cursor
    .FIELDS(6).Legend = "De 91 a 180 días"
    .FIELDS(6).COLOR  = RGB(113, 198, 113)

    .FIELDS(7).FieldValue = "valorm180" && This is the name of the 3st column of the cursor
    .FIELDS(7).Legend = "De mas 180 días"
    .FIELDS(7).COLOR  = RGB(255, 193, 37)

    .FIELDS(8).FieldValue = "valorm360" && This is the name of the 3st column of the cursor
    .FIELDS(8).Legend = "De mas 360 días"
    .FIELDS(8).COLOR  = RGB(0, 238, 0)

    * Setting the title and subtitle
    .TITLE.CAPTION = "Cartera"
    .SubTitle.CAPTION = "Cartera según edades"
    .FONTNAME = "Tahoma"

    * Setting the Chart Depth ( 3d effect )
    .Depth = 10

    * Set the backColor
    .BACKCOLOR = RGB(255, 255, 255)

    * Set the captions for the axis
    .XAxis.CAPTION = "Edades de cartera"
    .YAxis.CAPTION = "Valores en pesos"
    .AxisLegend2.Rotation = -45
    .AxisLegend2.Alignment = 1 &&Derecha
    .ShowLineZero = .F.
    .ShowSideLegend =.T.
    .BrushType = 2
    .ColorType = 2

    * Draw the chart

    .DrawChart()

ENDWITH   

¿Qué esta mal, qué me falta para que al pasar el ratón por una barra me muestre el valor de dicha barra.?

Alejandro Garcia G.

unread,
Oct 7, 2016, 5:36:19 PM10/7/16
to Comunidad de Visual Foxpro en Español
Acá coloco una imagen del grafico.
Grafico.png

Germán Fabricio Valdez

unread,
Oct 7, 2016, 6:56:13 PM10/7/16
to Comunidad de Visual Foxpro en Español
en la ayuda que estoy leyendo de foxchart dice poner .ShowTips = .T. ponelo antes de drawchart()

Francisco ji

unread,
Oct 7, 2016, 8:14:32 PM10/7/16
to Comunidad de Visual Foxpro en Español

Felicidades Luis María, que lo pases de lo mejor.




De: publice...@googlegroups.com <publice...@googlegroups.com> en nombre de Germán Fabricio Valdez <gfva...@gmail.com>
Enviado: viernes, 7 de octubre de 2016 10:56 p. m.
Para: Comunidad de Visual Foxpro en Español
Asunto: [vfp] Re: Ayuda: ToolTip en grafico FoxCharts
 

Alejandro Garcia G.

unread,
Oct 8, 2016, 10:57:41 AM10/8/16
to Comunidad de Visual Foxpro en Español

Germán, gracias por responder, pero nada, ya lo he intentado, coloco el .ShowTips nates del .DrawChart() y nada.

Germán Fabricio Valdez

unread,
Oct 8, 2016, 12:41:28 PM10/8/16
to Comunidad de Visual Foxpro en Español
baje FoxCharts_1.37b ALPHA y en todos los ejemplos se ve el detalle cuando pasas el mouse por el grafico

Alejandro Garcia G.

unread,
Oct 8, 2016, 12:52:54 PM10/8/16
to Comunidad de Visual Foxpro en Español
Esa es la versión que tengo, he leido los manuales, me he fijado de los ejemplos, hasta realice una pequeña rutina en ShapeTooTip y nada.

Germán Fabricio Valdez

unread,
Oct 8, 2016, 2:34:30 PM10/8/16
to Comunidad de Visual Foxpro en Español
proba charttype=7 que simple bar

Germán Fabricio Valdez

unread,
Oct 8, 2016, 2:35:00 PM10/8/16
to Comunidad de Visual Foxpro en Español
proba charttype=7

integral

unread,
Oct 9, 2016, 8:02:07 PM10/9/16
to Comunidad de Visual Foxpro en Español

Estimado Amigo :

En relación a tu problema resulta algo curioso, te muestro un ejemplo donde se aprecia el efecto deseado..

Saludos,

INTEGRAL
FoxCharts_1.37b ALPHA_Ejemplo.jpg

Alejandro Garcia G.

unread,
Oct 10, 2016, 10:09:08 AM10/10/16
to Comunidad de Visual Foxpro en Español
Integral, saludos.

Hasta hoy vuelvo a "conectarme". Sí, es curioso mi caso, es mas, yo ejecuto los ejemplos que trar la clase y otros que he encontrado y todo sale bien, pero cuando ejecuto mi código (que lo publique mas arriba) no me los muesra, ;(. En cualquier caso, he optado por hacer todo de nuevo para ver que puede ser, no se si es mi clase formulario o que...

Les comento cuando lo haga una vez mas.

Gracias a todos.

P.D.: Algo igual de curioso, cuando coloco el tipo 7, solo me muestra la primera barra, las otras no las tiene en cuenta, si lo regreso a tipo 9, me sale bien. Lo unico que camibo es esta instrucción: .ChartType = 9 o .ChartType = 7.

integral

unread,
Oct 10, 2016, 6:57:38 PM10/10/16
to Comunidad de Visual Foxpro en Español

Amigo ALEJANDRO :

Estaba pensando si subes el formulario y la tabla ligada así se podrá revidar creo mejor...

Es solo una sugerencia...

atte.,

INTEGRAL

El viernes, 7 de octubre de 2016, 16:16:47 (UTC-5), Alejandro Garcia G. escribió:
Reply all
Reply to author
Forward
0 new messages